blob: d1fa15fcf1bc1612b2581f266e80ba032d1765bf [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
Jesse Hall56d386a2016-07-26 15:20:40 -070031define VERSION_PATCH 22
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall33faaad2016-01-24 21:00:49 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall26763382016-05-20 07:13:52 -070051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall33faaad2016-01-24 21:00:49 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Chris Forbes8e4438b2016-12-07 16:26:49 +130078@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
Chia-I Wub262ddc2016-03-22 07:38:20 +080079@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
80
Jesse Hall56d386a2016-07-26 15:20:40 -070081@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 3
Jesse Hall715b86a2016-01-16 16:34:29 -080082@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
83
Jesse Hall26763382016-05-20 07:13:52 -070084@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
85@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
86
87@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
88@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
89
90@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
91@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
92
93@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
94@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
95
Jesse Hall56d386a2016-07-26 15:20:40 -070096@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
97@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
98
99@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
100@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
101
Jesse Hall26763382016-05-20 07:13:52 -0700102@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
103@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
104
Jesse Hall56d386a2016-07-26 15:20:40 -0700105@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
106@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
107
108@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
109@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
110
Jesse Halld27f6aa2015-08-15 17:58:48 -0700111
112/////////////
113// Types //
114/////////////
115
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700116type u32 VkBool32
117type u32 VkFlags
118type u64 VkDeviceSize
119type u32 VkSampleMask
120
Jesse Halld27f6aa2015-08-15 17:58:48 -0700121/// Dispatchable handle types.
122@dispatchHandle type u64 VkInstance
123@dispatchHandle type u64 VkPhysicalDevice
124@dispatchHandle type u64 VkDevice
125@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800126@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700127
128/// Non dispatchable handle types.
129@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800130@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700131@nonDispatchHandle type u64 VkBuffer
132@nonDispatchHandle type u64 VkBufferView
133@nonDispatchHandle type u64 VkImage
134@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700135@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700136@nonDispatchHandle type u64 VkPipeline
137@nonDispatchHandle type u64 VkPipelineLayout
138@nonDispatchHandle type u64 VkSampler
139@nonDispatchHandle type u64 VkDescriptorSet
140@nonDispatchHandle type u64 VkDescriptorSetLayout
141@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700142@nonDispatchHandle type u64 VkFence
143@nonDispatchHandle type u64 VkSemaphore
144@nonDispatchHandle type u64 VkEvent
145@nonDispatchHandle type u64 VkQueryPool
146@nonDispatchHandle type u64 VkFramebuffer
147@nonDispatchHandle type u64 VkRenderPass
148@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800149
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800150@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800151
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800152@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800153
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800154@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
155@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700156
Jesse Hall715b86a2016-01-16 16:34:29 -0800157@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
158
Jesse Halld27f6aa2015-08-15 17:58:48 -0700159
160/////////////
161// Enums //
162/////////////
163
164enum VkImageLayout {
165 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
166 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
167 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
168 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
169 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
170 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 -0800171 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
172 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 -0700173 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800174
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800175 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800176 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700177}
178
179enum VkAttachmentLoadOp {
180 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
181 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
182 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
183}
184
185enum VkAttachmentStoreOp {
186 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
187 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
188}
189
190enum VkImageType {
191 VK_IMAGE_TYPE_1D = 0x00000000,
192 VK_IMAGE_TYPE_2D = 0x00000001,
193 VK_IMAGE_TYPE_3D = 0x00000002,
194}
195
196enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800197 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
198 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700199}
200
201enum VkImageViewType {
202 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
203 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
204 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
205 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
206 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
207 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
208 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
209}
210
Jesse Hall3fbc8562015-11-29 22:10:52 -0800211enum VkCommandBufferLevel {
212 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
213 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700214}
215
Jesse Hall65ab5522015-11-30 00:07:16 -0800216enum VkComponentSwizzle {
217 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
218 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
219 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
220 VK_COMPONENT_SWIZZLE_R = 0x00000003,
221 VK_COMPONENT_SWIZZLE_G = 0x00000004,
222 VK_COMPONENT_SWIZZLE_B = 0x00000005,
223 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700224}
225
226enum VkDescriptorType {
227 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
228 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
229 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
230 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
231 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
232 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
233 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
234 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
235 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
236 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
237 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
238}
239
Jesse Halld27f6aa2015-08-15 17:58:48 -0700240enum VkQueryType {
241 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
242 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800243 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700244}
245
Jesse Halld27f6aa2015-08-15 17:58:48 -0700246enum VkBorderColor {
247 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
248 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
249 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
250 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
251 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
252 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
253}
254
255enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800256 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
257 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700258}
259
260enum VkPrimitiveTopology {
261 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
262 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
263 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
264 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
265 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
266 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800267 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
268 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
269 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
270 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800271 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700272}
273
274enum VkSharingMode {
275 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
276 VK_SHARING_MODE_CONCURRENT = 0x00000001,
277}
278
279enum VkIndexType {
280 VK_INDEX_TYPE_UINT16 = 0x00000000,
281 VK_INDEX_TYPE_UINT32 = 0x00000001,
282}
283
Jesse Hall23ff73f2015-11-29 14:36:39 -0800284enum VkFilter {
285 VK_FILTER_NEAREST = 0x00000000,
286 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700287
288 //@extension("VK_IMG_filter_cubic")
289 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700290}
291
Jesse Hall23ff73f2015-11-29 14:36:39 -0800292enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800293 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
294 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700295}
296
Jesse Hall23ff73f2015-11-29 14:36:39 -0800297enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800298 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
299 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
300 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
301 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
302 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700303}
304
305enum VkCompareOp {
306 VK_COMPARE_OP_NEVER = 0x00000000,
307 VK_COMPARE_OP_LESS = 0x00000001,
308 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800309 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700310 VK_COMPARE_OP_GREATER = 0x00000004,
311 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800312 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700313 VK_COMPARE_OP_ALWAYS = 0x00000007,
314}
315
Jesse Hall65ab5522015-11-30 00:07:16 -0800316enum VkPolygonMode {
317 VK_POLYGON_MODE_FILL = 0x00000000,
318 VK_POLYGON_MODE_LINE = 0x00000001,
319 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700320}
321
322enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800323 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
324 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700325}
326
Jesse Hall65ab5522015-11-30 00:07:16 -0800327enum VkBlendFactor {
328 VK_BLEND_FACTOR_ZERO = 0x00000000,
329 VK_BLEND_FACTOR_ONE = 0x00000001,
330 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
331 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
332 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
333 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
334 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
335 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
336 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
337 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
338 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
339 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
340 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
341 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
342 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
343 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
344 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
345 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
346 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700347}
348
349enum VkBlendOp {
350 VK_BLEND_OP_ADD = 0x00000000,
351 VK_BLEND_OP_SUBTRACT = 0x00000001,
352 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
353 VK_BLEND_OP_MIN = 0x00000003,
354 VK_BLEND_OP_MAX = 0x00000004,
355}
356
357enum VkStencilOp {
358 VK_STENCIL_OP_KEEP = 0x00000000,
359 VK_STENCIL_OP_ZERO = 0x00000001,
360 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800361 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
362 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700363 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800364 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
365 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700366}
367
368enum VkLogicOp {
369 VK_LOGIC_OP_CLEAR = 0x00000000,
370 VK_LOGIC_OP_AND = 0x00000001,
371 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
372 VK_LOGIC_OP_COPY = 0x00000003,
373 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800374 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700375 VK_LOGIC_OP_XOR = 0x00000006,
376 VK_LOGIC_OP_OR = 0x00000007,
377 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800378 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700379 VK_LOGIC_OP_INVERT = 0x0000000a,
380 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
381 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
382 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
383 VK_LOGIC_OP_NAND = 0x0000000e,
384 VK_LOGIC_OP_SET = 0x0000000f,
385}
386
Jesse Hall3fbc8562015-11-29 22:10:52 -0800387enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800388 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800389 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
390 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
391 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
392 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800393}
394
Jesse Hall3fbc8562015-11-29 22:10:52 -0800395enum VkInternalAllocationType {
396 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700397}
398
399enum VkPhysicalDeviceType {
400 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
401 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
402 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
403 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
404 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
405}
406
Jesse Hall65ab5522015-11-30 00:07:16 -0800407enum VkVertexInputRate {
408 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
409 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700410}
411
412/// Vulkan format definitions
413enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800414 VK_FORMAT_UNDEFINED = 0,
415 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
416 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
417 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
418 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
419 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
420 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
421 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
422 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
423 VK_FORMAT_R8_UNORM = 9,
424 VK_FORMAT_R8_SNORM = 10,
425 VK_FORMAT_R8_USCALED = 11,
426 VK_FORMAT_R8_SSCALED = 12,
427 VK_FORMAT_R8_UINT = 13,
428 VK_FORMAT_R8_SINT = 14,
429 VK_FORMAT_R8_SRGB = 15,
430 VK_FORMAT_R8G8_UNORM = 16,
431 VK_FORMAT_R8G8_SNORM = 17,
432 VK_FORMAT_R8G8_USCALED = 18,
433 VK_FORMAT_R8G8_SSCALED = 19,
434 VK_FORMAT_R8G8_UINT = 20,
435 VK_FORMAT_R8G8_SINT = 21,
436 VK_FORMAT_R8G8_SRGB = 22,
437 VK_FORMAT_R8G8B8_UNORM = 23,
438 VK_FORMAT_R8G8B8_SNORM = 24,
439 VK_FORMAT_R8G8B8_USCALED = 25,
440 VK_FORMAT_R8G8B8_SSCALED = 26,
441 VK_FORMAT_R8G8B8_UINT = 27,
442 VK_FORMAT_R8G8B8_SINT = 28,
443 VK_FORMAT_R8G8B8_SRGB = 29,
444 VK_FORMAT_B8G8R8_UNORM = 30,
445 VK_FORMAT_B8G8R8_SNORM = 31,
446 VK_FORMAT_B8G8R8_USCALED = 32,
447 VK_FORMAT_B8G8R8_SSCALED = 33,
448 VK_FORMAT_B8G8R8_UINT = 34,
449 VK_FORMAT_B8G8R8_SINT = 35,
450 VK_FORMAT_B8G8R8_SRGB = 36,
451 VK_FORMAT_R8G8B8A8_UNORM = 37,
452 VK_FORMAT_R8G8B8A8_SNORM = 38,
453 VK_FORMAT_R8G8B8A8_USCALED = 39,
454 VK_FORMAT_R8G8B8A8_SSCALED = 40,
455 VK_FORMAT_R8G8B8A8_UINT = 41,
456 VK_FORMAT_R8G8B8A8_SINT = 42,
457 VK_FORMAT_R8G8B8A8_SRGB = 43,
458 VK_FORMAT_B8G8R8A8_UNORM = 44,
459 VK_FORMAT_B8G8R8A8_SNORM = 45,
460 VK_FORMAT_B8G8R8A8_USCALED = 46,
461 VK_FORMAT_B8G8R8A8_SSCALED = 47,
462 VK_FORMAT_B8G8R8A8_UINT = 48,
463 VK_FORMAT_B8G8R8A8_SINT = 49,
464 VK_FORMAT_B8G8R8A8_SRGB = 50,
465 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
466 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
467 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
468 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
469 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
470 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
471 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
472 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
473 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
474 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
475 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
476 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
477 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
478 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
479 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
480 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
481 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
482 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
483 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
484 VK_FORMAT_R16_UNORM = 70,
485 VK_FORMAT_R16_SNORM = 71,
486 VK_FORMAT_R16_USCALED = 72,
487 VK_FORMAT_R16_SSCALED = 73,
488 VK_FORMAT_R16_UINT = 74,
489 VK_FORMAT_R16_SINT = 75,
490 VK_FORMAT_R16_SFLOAT = 76,
491 VK_FORMAT_R16G16_UNORM = 77,
492 VK_FORMAT_R16G16_SNORM = 78,
493 VK_FORMAT_R16G16_USCALED = 79,
494 VK_FORMAT_R16G16_SSCALED = 80,
495 VK_FORMAT_R16G16_UINT = 81,
496 VK_FORMAT_R16G16_SINT = 82,
497 VK_FORMAT_R16G16_SFLOAT = 83,
498 VK_FORMAT_R16G16B16_UNORM = 84,
499 VK_FORMAT_R16G16B16_SNORM = 85,
500 VK_FORMAT_R16G16B16_USCALED = 86,
501 VK_FORMAT_R16G16B16_SSCALED = 87,
502 VK_FORMAT_R16G16B16_UINT = 88,
503 VK_FORMAT_R16G16B16_SINT = 89,
504 VK_FORMAT_R16G16B16_SFLOAT = 90,
505 VK_FORMAT_R16G16B16A16_UNORM = 91,
506 VK_FORMAT_R16G16B16A16_SNORM = 92,
507 VK_FORMAT_R16G16B16A16_USCALED = 93,
508 VK_FORMAT_R16G16B16A16_SSCALED = 94,
509 VK_FORMAT_R16G16B16A16_UINT = 95,
510 VK_FORMAT_R16G16B16A16_SINT = 96,
511 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
512 VK_FORMAT_R32_UINT = 98,
513 VK_FORMAT_R32_SINT = 99,
514 VK_FORMAT_R32_SFLOAT = 100,
515 VK_FORMAT_R32G32_UINT = 101,
516 VK_FORMAT_R32G32_SINT = 102,
517 VK_FORMAT_R32G32_SFLOAT = 103,
518 VK_FORMAT_R32G32B32_UINT = 104,
519 VK_FORMAT_R32G32B32_SINT = 105,
520 VK_FORMAT_R32G32B32_SFLOAT = 106,
521 VK_FORMAT_R32G32B32A32_UINT = 107,
522 VK_FORMAT_R32G32B32A32_SINT = 108,
523 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
524 VK_FORMAT_R64_UINT = 110,
525 VK_FORMAT_R64_SINT = 111,
526 VK_FORMAT_R64_SFLOAT = 112,
527 VK_FORMAT_R64G64_UINT = 113,
528 VK_FORMAT_R64G64_SINT = 114,
529 VK_FORMAT_R64G64_SFLOAT = 115,
530 VK_FORMAT_R64G64B64_UINT = 116,
531 VK_FORMAT_R64G64B64_SINT = 117,
532 VK_FORMAT_R64G64B64_SFLOAT = 118,
533 VK_FORMAT_R64G64B64A64_UINT = 119,
534 VK_FORMAT_R64G64B64A64_SINT = 120,
535 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
536 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
537 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
538 VK_FORMAT_D16_UNORM = 124,
539 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
540 VK_FORMAT_D32_SFLOAT = 126,
541 VK_FORMAT_S8_UINT = 127,
542 VK_FORMAT_D16_UNORM_S8_UINT = 128,
543 VK_FORMAT_D24_UNORM_S8_UINT = 129,
544 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
545 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
546 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
547 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
548 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
549 VK_FORMAT_BC2_UNORM_BLOCK = 135,
550 VK_FORMAT_BC2_SRGB_BLOCK = 136,
551 VK_FORMAT_BC3_UNORM_BLOCK = 137,
552 VK_FORMAT_BC3_SRGB_BLOCK = 138,
553 VK_FORMAT_BC4_UNORM_BLOCK = 139,
554 VK_FORMAT_BC4_SNORM_BLOCK = 140,
555 VK_FORMAT_BC5_UNORM_BLOCK = 141,
556 VK_FORMAT_BC5_SNORM_BLOCK = 142,
557 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
558 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
559 VK_FORMAT_BC7_UNORM_BLOCK = 145,
560 VK_FORMAT_BC7_SRGB_BLOCK = 146,
561 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
562 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
563 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
564 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
565 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
566 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
567 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
568 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
569 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
570 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
571 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
572 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
573 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
574 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
575 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
576 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
577 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
578 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
579 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
580 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
581 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
582 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
583 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
584 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
585 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
586 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
587 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
588 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
589 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
590 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
591 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
592 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
593 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
594 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
595 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
596 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
597 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
598 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700599}
600
Jesse Halld27f6aa2015-08-15 17:58:48 -0700601/// Structure type enumerant
602enum VkStructureType {
603 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800604 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
605 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
606 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
607 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800608 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800609 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
610 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
611 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
612 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700613 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800614 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
615 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
616 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
617 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
618 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
619 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800620 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
621 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
622 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
623 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
624 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
625 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
626 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
627 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
628 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
629 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
630 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
631 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
632 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
633 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
634 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
635 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
636 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800637 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800638 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
639 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
640 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
641 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
642 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800643 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800644 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
645 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
646 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
647 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
648 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
649 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
650 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
651 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800652
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800653 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800654 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
655 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800656
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800657 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800658 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
659 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800660
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800661 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800662 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800663
664 //@extension("VK_KHR_xlib_surface")
665 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
666
667 //@extension("VK_KHR_xcb_surface")
668 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
669
670 //@extension("VK_KHR_wayland_surface")
671 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
672
673 //@extension("VK_KHR_mir_surface")
674 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
675
676 //@extension("VK_KHR_android_surface")
677 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
678
679 //@extension("VK_KHR_win32_surface")
680 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800681
Chia-I Wub262ddc2016-03-22 07:38:20 +0800682 //@extension("VK_ANDROID_native_buffer")
683 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300684 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800685
Jesse Hall543a7ff2016-01-08 16:38:30 -0800686 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700687 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
688
689 //@extension("VK_AMD_rasterization_order")
690 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
691
692 //@extension("VK_EXT_debug_marker")
693 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
694
695 //@extension("VK_EXT_debug_marker")
696 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
697
698 //@extension("VK_EXT_debug_marker")
699 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700700
701 //@extension("VK_NV_dedicated_allocation")
702 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
703
704 //@extension("VK_NV_dedicated_allocation")
705 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
706
707 //@extension("VK_NV_dedicated_allocation")
708 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700709}
710
Jesse Hall65ab5522015-11-30 00:07:16 -0800711enum VkSubpassContents {
712 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
713 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700714}
715
Jesse Hall543a7ff2016-01-08 16:38:30 -0800716enum VkPipelineCacheHeaderVersion {
717 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
718}
719
Jesse Hallbd888842015-11-30 21:44:14 -0800720@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700721/// Error and return codes
722enum VkResult {
723 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800724 VK_SUCCESS = 0,
725 VK_NOT_READY = 1,
726 VK_TIMEOUT = 2,
727 VK_EVENT_SET = 3,
728 VK_EVENT_RESET = 4,
729 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700730
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800731 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800732 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800733
Jesse Halld27f6aa2015-08-15 17:58:48 -0700734 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800735 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
736 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
737 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
738 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
739 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
740 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
741 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
742 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
743 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
744 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
745 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700746 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800747
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800748 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800749 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800750
Jesse Hall563380d2016-01-15 23:14:05 -0800751 //@extension("VK_KHR_surface")
752 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
753
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800754 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800755 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800756
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800757 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800758 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800759
Jesse Hall543a7ff2016-01-08 16:38:30 -0800760 //@extension("VK_EXT_debug_report")
761 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700762
763 //@extension("VK_NV_glsl_shader")
764 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700765}
766
767enum VkDynamicState {
768 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
769 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
770 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
771 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
772 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
773 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
774 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
775 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
776 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700777}
778
Jesse Hall523db342015-11-30 21:12:55 -0800779@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800780enum VkPresentModeKHR {
781 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
782 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
783 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800784 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800785}
786
Jesse Hall523db342015-11-30 21:12:55 -0800787@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800788enum VkColorSpaceKHR {
789 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
790}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700791
Jesse Hall715b86a2016-01-16 16:34:29 -0800792@extension("VK_EXT_debug_report")
793enum VkDebugReportObjectTypeEXT {
794 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
795 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
796 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
797 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
798 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
799 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
800 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
801 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
802 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
803 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
804 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
805 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
806 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
807 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
808 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
809 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
810 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
811 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
812 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
813 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
814 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
815 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
816 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
817 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
818 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
819 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
820 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
821 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
822 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
823}
824
825@extension("VK_EXT_debug_report")
826enum VkDebugReportErrorEXT {
827 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
828 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
829}
830
Jesse Hall26763382016-05-20 07:13:52 -0700831@extension("VK_AMD_rasterization_order")
832enum VkRasterizationOrderAMD {
833 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
834 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
835}
836
Jesse Hall715b86a2016-01-16 16:34:29 -0800837
Jesse Halld27f6aa2015-08-15 17:58:48 -0700838/////////////////
839// Bitfields //
840/////////////////
841
Jesse Halld27f6aa2015-08-15 17:58:48 -0700842/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -0800843type VkFlags VkQueueFlags
844bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700845 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
846 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -0800847 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -0800848 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700849}
850
851/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -0800852type VkFlags VkMemoryPropertyFlags
853bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800854 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
855 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
856 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
857 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
858 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700859}
860
861/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -0800862type VkFlags VkMemoryHeapFlags
863bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800864 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700865}
866
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800867/// Access flags
868type VkFlags VkAccessFlags
869bitfield VkAccessFlagBits {
870 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
871 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
872 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
873 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
874 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
875 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
876 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
877 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
878 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
879 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
880 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
881 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
882 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
883 VK_ACCESS_HOST_READ_BIT = 0x00002000,
884 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
885 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
886 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700887}
888
889/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800890type VkFlags VkBufferUsageFlags
891bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800892 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
893 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700894 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
895 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
896 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
897 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
898 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
899 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
900 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
901}
902
903/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800904type VkFlags VkBufferCreateFlags
905bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700906 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700907 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
908 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
909}
910
911/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800912type VkFlags VkShaderStageFlags
913bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700914 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -0800915 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
916 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700917 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
918 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
919 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -0800920 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700921
922 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
923}
924
Jesse Hallfbf97b02015-11-20 14:17:03 -0800925/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -0800926type VkFlags VkDescriptorPoolCreateFlags
927bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800928 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
929}
930
931/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -0800932type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -0800933//bitfield VkDescriptorPoolResetFlagBits {
934//}
Jesse Hallfbf97b02015-11-20 14:17:03 -0800935
Jesse Halld27f6aa2015-08-15 17:58:48 -0700936/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800937type VkFlags VkImageUsageFlags
938bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800939 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
940 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700941 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
942 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
943 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700944 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -0700945 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
946 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
947}
948
949/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800950type VkFlags VkImageCreateFlags
951bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700952 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700953 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
954 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 -0700955 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
956 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 -0700957}
958
Jesse Hallb00daad2015-11-29 19:46:20 -0800959/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800960type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -0800961//bitfield VkImageViewCreateFlagBits {
962//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700963
964/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800965type VkFlags VkPipelineCreateFlags
966bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700967 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
968 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
969 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
970}
971
Jesse Hall65ab5522015-11-30 00:07:16 -0800972/// Color component flags
973type VkFlags VkColorComponentFlags
974bitfield VkColorComponentFlagBits {
975 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
976 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
977 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
978 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700979}
980
981/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800982type VkFlags VkFenceCreateFlags
983bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700984 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
985}
986
987/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800988type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800989//bitfield VkSemaphoreCreateFlagBits {
990//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700991
992/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -0800993type VkFlags VkFormatFeatureFlags
994bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700995 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
996 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
997 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
998 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
999 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1000 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1001 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1002 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1003 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1004 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001005 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1006 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 -08001007 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001008
1009 //@extension("VK_IMG_filter_cubic")
1010 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001011}
1012
1013/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001014type VkFlags VkQueryControlFlags
1015bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001016 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001017}
1018
1019/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001020type VkFlags VkQueryResultFlags
1021bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001022 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1023 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1024 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1025 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1026}
1027
1028/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001029type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001030//bitfield VkShaderModuleCreateFlagBits {
1031//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001032
Jesse Halld27f6aa2015-08-15 17:58:48 -07001033/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001034type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001035//bitfield VkEventCreateFlagBits {
1036//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001037
Jesse Halla15a4bf2015-11-19 22:48:02 -08001038/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001039type VkFlags VkCommandBufferUsageFlags
1040bitfield VkCommandBufferUsageFlagBits {
1041 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1042 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1043 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001044}
1045
1046/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001047type VkFlags VkQueryPipelineStatisticFlags
1048bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001049 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1050 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1051 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1052 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1053 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1054 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1055 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1056 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1057 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1058 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1059 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001060}
1061
1062/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001063type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001064//bitfield VkMemoryMapFlagBits {
1065//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001066
1067/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001068type VkFlags VkImageAspectFlags
1069bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001070 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1071 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1072 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1073 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1074}
1075
1076/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001077type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001078bitfield VkSparseMemoryBindFlagBits {
1079 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1080}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001081
1082/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001083type VkFlags VkSparseImageFormatFlags
1084bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001085 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1086 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.
1087 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001088}
1089
1090/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001091type VkFlags VkPipelineStageFlags
1092bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001093 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1094 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1095 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1096 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001097 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1098 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001099 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1100 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1101 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1102 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1103 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1104 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1105 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001106 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1107 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001108
Jesse Hall543a7ff2016-01-08 16:38:30 -08001109 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1110 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001111}
1112
1113/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001114type VkFlags VkAttachmentDescriptionFlags
1115bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001116 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 -07001117}
1118
1119/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001120type VkFlags VkSubpassDescriptionFlags
1121bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001122}
1123
1124/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001125type VkFlags VkCommandPoolCreateFlags
1126bitfield VkCommandPoolCreateFlagBits {
1127 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1128 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001129}
1130
1131/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001132type VkFlags VkCommandPoolResetFlags
1133bitfield VkCommandPoolResetFlagBits {
1134 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001135}
1136
Jesse Hall3fbc8562015-11-29 22:10:52 -08001137type VkFlags VkCommandBufferResetFlags
1138bitfield VkCommandBufferResetFlagBits {
1139 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001140}
1141
Jesse Halld8bade02015-11-24 10:24:18 -08001142type VkFlags VkSampleCountFlags
1143bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001144 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1145 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1146 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1147 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1148 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1149 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1150 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1151}
1152
Jesse Halld8bade02015-11-24 10:24:18 -08001153type VkFlags VkStencilFaceFlags
1154bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001155 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1156 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001157 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001158}
1159
Jesse Halla6429252015-11-29 18:59:42 -08001160/// Instance creation flags
1161type VkFlags VkInstanceCreateFlags
1162//bitfield VkInstanceCreateFlagBits {
1163//}
1164
1165/// Device creation flags
1166type VkFlags VkDeviceCreateFlags
1167//bitfield VkDeviceCreateFlagBits {
1168//}
1169
1170/// Device queue creation flags
1171type VkFlags VkDeviceQueueCreateFlags
1172//bitfield VkDeviceQueueCreateFlagBits {
1173//}
1174
1175/// Query pool creation flags
1176type VkFlags VkQueryPoolCreateFlags
1177//bitfield VkQueryPoolCreateFlagBits {
1178//}
1179
1180/// Buffer view creation flags
1181type VkFlags VkBufferViewCreateFlags
1182//bitfield VkBufferViewCreateFlagBits {
1183//}
1184
1185/// Pipeline cache creation flags
1186type VkFlags VkPipelineCacheCreateFlags
1187//bitfield VkPipelineCacheCreateFlagBits {
1188//}
1189
1190/// Pipeline shader stage creation flags
1191type VkFlags VkPipelineShaderStageCreateFlags
1192//bitfield VkPipelineShaderStageCreateFlagBits {
1193//}
1194
1195/// Descriptor set layout creation flags
1196type VkFlags VkDescriptorSetLayoutCreateFlags
1197//bitfield VkDescriptorSetLayoutCreateFlagBits {
1198//}
1199
1200/// Pipeline vertex input state creation flags
1201type VkFlags VkPipelineVertexInputStateCreateFlags
1202//bitfield VkPipelineVertexInputStateCreateFlagBits {
1203//}
1204
1205/// Pipeline input assembly state creation flags
1206type VkFlags VkPipelineInputAssemblyStateCreateFlags
1207//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1208//}
1209
1210/// Tessellation state creation flags
1211type VkFlags VkPipelineTessellationStateCreateFlags
1212//bitfield VkPipelineTessellationStateCreateFlagBits {
1213//}
1214
1215/// Viewport state creation flags
1216type VkFlags VkPipelineViewportStateCreateFlags
1217//bitfield VkPipelineViewportStateCreateFlagBits {
1218//}
1219
Jesse Hall3fbc8562015-11-29 22:10:52 -08001220/// Rasterization state creation flags
1221type VkFlags VkPipelineRasterizationStateCreateFlags
1222//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001223//}
1224
1225/// Multisample state creation flags
1226type VkFlags VkPipelineMultisampleStateCreateFlags
1227//bitfield VkPipelineMultisampleStateCreateFlagBits {
1228//}
1229
1230/// Color blend state creation flags
1231type VkFlags VkPipelineColorBlendStateCreateFlags
1232//bitfield VkPipelineColorBlendStateCreateFlagBits {
1233//}
1234
1235/// Depth/stencil state creation flags
1236type VkFlags VkPipelineDepthStencilStateCreateFlags
1237//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1238//}
1239
1240/// Dynamic state creation flags
1241type VkFlags VkPipelineDynamicStateCreateFlags
1242//bitfield VkPipelineDynamicStateCreateFlagBits {
1243//}
1244
1245/// Pipeline layout creation flags
1246type VkFlags VkPipelineLayoutCreateFlags
1247//bitfield VkPipelineLayoutCreateFlagBits {
1248//}
1249
1250/// Sampler creation flags
1251type VkFlags VkSamplerCreateFlags
1252//bitfield VkSamplerCreateFlagBits {
1253//}
1254
1255/// Render pass creation flags
1256type VkFlags VkRenderPassCreateFlags
1257//bitfield VkRenderPassCreateFlagBits {
1258//}
1259
1260/// Framebuffer creation flags
1261type VkFlags VkFramebufferCreateFlags
1262//bitfield VkFramebufferCreateFlagBits {
1263//}
1264
Jesse Halldc6d36c2015-11-29 19:12:15 -08001265/// Dependency flags
1266type VkFlags VkDependencyFlags
1267bitfield VkDependencyFlagBits {
1268 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1269}
1270
Jesse Hallc7467b72015-11-29 21:05:26 -08001271/// Cull mode flags
1272type VkFlags VkCullModeFlags
1273bitfield VkCullModeFlagBits {
1274 VK_CULL_MODE_NONE = 0x00000000,
1275 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1276 VK_CULL_MODE_BACK_BIT = 0x00000002,
1277 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1278}
1279
Jesse Hall523db342015-11-30 21:12:55 -08001280@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001281type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001282@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001283bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001284 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001285 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1286 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1287 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1288 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1289 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1290 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1291 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1292 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001293}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001294
Jesse Hall523db342015-11-30 21:12:55 -08001295@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001296type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001297@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001298bitfield VkCompositeAlphaFlagBitsKHR {
1299 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1300 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1301 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1302 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1303}
1304
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001305@extension("VK_KHR_swapchain")
1306type VkFlags VkSwapchainCreateFlagsKHR
1307//@extension("VK_KHR_swapchain")
1308//bitfield VkSwapchainCreateFlagBitsKHR {
1309//}
1310
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001311@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001312type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001313@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001314bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001315 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1316 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1317 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1318 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001319}
1320
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001321@extension("VK_KHR_display")
1322type VkFlags VkDisplaySurfaceCreateFlagsKHR
1323//@extension("VK_KHR_display")
1324//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1325//}
1326
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001327@extension("VK_KHR_display")
1328type VkFlags VkDisplayModeCreateFlagsKHR
1329//@extension("VK_KHR_display")
1330//bitfield VkDisplayModeCreateFlagBitsKHR {
1331//}
1332
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001333@extension("VK_KHR_xlib_surface")
1334type VkFlags VkXlibSurfaceCreateFlagsKHR
1335//@extension("VK_KHR_xlib_surface")
1336//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1337//}
1338
1339@extension("VK_KHR_xcb_surface")
1340type VkFlags VkXcbSurfaceCreateFlagsKHR
1341//@extension("VK_KHR_xcb_surface")
1342//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1343//}
1344
1345@extension("VK_KHR_wayland_surface")
1346type VkFlags VkWaylandSurfaceCreateFlagsKHR
1347//@extension("VK_KHR_wayland_surface")
1348//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1349//}
1350
1351@extension("VK_KHR_mir_surface")
1352type VkFlags VkMirSurfaceCreateFlagsKHR
1353//@extension("VK_KHR_mir_surface")
1354//bitfield VkMirSurfaceCreateFlagBitsKHR {
1355//}
1356
1357@extension("VK_KHR_android_surface")
1358type VkFlags VkAndroidSurfaceCreateFlagsKHR
1359//@extension("VK_KHR_android_surface")
1360//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1361//}
1362
1363@extension("VK_KHR_win32_surface")
1364type VkFlags VkWin32SurfaceCreateFlagsKHR
1365//@extension("VK_KHR_win32_surface")
1366//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1367//}
1368
Jesse Hall715b86a2016-01-16 16:34:29 -08001369@extension("VK_EXT_debug_report")
1370type VkFlags VkDebugReportFlagsEXT
1371@extension("VK_EXT_debug_report")
1372bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001373 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1374 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1375 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001376 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1377 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1378}
1379
Chris Forbes8e4438b2016-12-07 16:26:49 +13001380@extension("VK_ANDROID_native_buffer")
1381type VkFlags VkSwapchainImageUsageFlagsANDROID
1382@extension("VK_ANDROID_native_buffer")
1383bitfield VkSwapchainImageUsageFlagBitsANDROID {
1384 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_FRONT_BUFFER_BIT_ANDROID = 0x00000001,
1385}
1386
Jesse Hall1356b0d2015-11-23 17:24:58 -08001387
Jesse Halld27f6aa2015-08-15 17:58:48 -07001388//////////////////
1389// Structures //
1390//////////////////
1391
1392class VkOffset2D {
1393 s32 x
1394 s32 y
1395}
1396
1397class VkOffset3D {
1398 s32 x
1399 s32 y
1400 s32 z
1401}
1402
1403class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001404 u32 width
1405 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001406}
1407
1408class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001409 u32 width
1410 u32 height
1411 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001412}
1413
1414class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001415 f32 x
1416 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001417 f32 width
1418 f32 height
1419 f32 minDepth
1420 f32 maxDepth
1421}
1422
1423class VkRect2D {
1424 VkOffset2D offset
1425 VkExtent2D extent
1426}
1427
Jesse Halla15a4bf2015-11-19 22:48:02 -08001428class VkClearRect {
1429 VkRect2D rect
1430 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001431 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001432}
1433
Jesse Hall65ab5522015-11-30 00:07:16 -08001434class VkComponentMapping {
1435 VkComponentSwizzle r
1436 VkComponentSwizzle g
1437 VkComponentSwizzle b
1438 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001439}
1440
1441class VkPhysicalDeviceProperties {
1442 u32 apiVersion
1443 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001444 u32 vendorID
1445 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001446 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001447 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1448 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001449 VkPhysicalDeviceLimits limits
1450 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001451}
1452
1453class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001454 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001455 u32 specVersion /// version of the extension specification implemented
1456}
1457
1458class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001459 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001460 u32 specVersion /// version of the layer specification implemented
1461 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001462 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001463}
1464
Jesse Halla366a512015-11-19 22:30:07 -08001465class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001466 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1467 const void* pNext /// Next structure in chain
1468 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001469 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001470 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001471 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001472 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001473 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001474 const VkSemaphore* pSignalSemaphores
1475}
1476
Jesse Halld27f6aa2015-08-15 17:58:48 -07001477class VkApplicationInfo {
1478 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1479 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001480 const char* pApplicationName
1481 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001482 const char* pEngineName
1483 u32 engineVersion
1484 u32 apiVersion
1485}
1486
Jesse Hall3fbc8562015-11-29 22:10:52 -08001487class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001488 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001489 PFN_vkAllocationFunction pfnAllocation
1490 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001491 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001492 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001493 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001494}
1495
1496class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001497 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1498 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001499 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001500 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001501 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001502 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001503}
1504
1505class VkDeviceCreateInfo {
1506 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1507 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001508 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001509 u32 queueCreateInfoCount
1510 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001511 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001512 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001513 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001514 const char* const* ppEnabledExtensionNames
1515 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001516}
1517
1518class VkInstanceCreateInfo {
1519 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1520 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001521 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001522 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001523 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001524 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001525 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001526 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1527}
1528
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001529class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001530 VkQueueFlags queueFlags /// Queue flags
1531 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001532 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001533 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001534}
1535
1536class VkPhysicalDeviceMemoryProperties {
1537 u32 memoryTypeCount
1538 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1539 u32 memoryHeapCount
1540 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1541}
1542
Jesse Hall3fbc8562015-11-29 22:10:52 -08001543class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001544 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001545 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001546 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001547 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1548}
1549
1550class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001551 VkDeviceSize size /// Specified in bytes
1552 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001553 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1554}
1555
1556class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001557 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001558 VkExtent3D imageGranularity
1559 VkSparseImageFormatFlags flags
1560}
1561
1562class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001563 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001564 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001565 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1566 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1567 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001568}
1569
1570class VkMemoryType {
1571 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1572 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1573}
1574
1575class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001576 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001577 VkMemoryHeapFlags flags /// Flags for the heap
1578}
1579
1580class VkMappedMemoryRange {
1581 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1582 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001583 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001584 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1585 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001586}
1587
1588class VkFormatProperties {
1589 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1590 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001591 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001592}
1593
1594class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001595 VkExtent3D maxExtent /// max image dimensions for this resource type
1596 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001597 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001598 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1599 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1600}
1601
Jesse Halla15a4bf2015-11-19 22:48:02 -08001602class VkDescriptorImageInfo {
1603 VkSampler sampler
1604 VkImageView imageView
1605 VkImageLayout imageLayout
1606}
1607
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001608class VkDescriptorBufferInfo {
1609 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1610 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1611 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001612}
1613
Jesse Halld27f6aa2015-08-15 17:58:48 -07001614class VkWriteDescriptorSet {
1615 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1616 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001617 VkDescriptorSet dstSet /// Destination descriptor set
1618 u32 dstBinding /// Binding within the destination descriptor set to write
1619 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001620 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001621 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 -08001622 const VkDescriptorImageInfo* pImageInfo
1623 const VkDescriptorBufferInfo* pBufferInfo
1624 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001625}
1626
1627class VkCopyDescriptorSet {
1628 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1629 const void* pNext /// Pointer to next structure
1630 VkDescriptorSet srcSet /// Source descriptor set
1631 u32 srcBinding /// Binding within the source descriptor set to copy from
1632 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001633 VkDescriptorSet dstSet /// Destination descriptor set
1634 u32 dstBinding /// Binding within the destination descriptor set to copy to
1635 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001636 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001637}
1638
1639class VkBufferCreateInfo {
1640 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1641 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001642 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001643 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001644 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001645 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001646 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001647 const u32* pQueueFamilyIndices
1648}
1649
1650class VkBufferViewCreateInfo {
1651 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1652 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001653 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001654 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001655 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001656 VkDeviceSize offset /// Specified in bytes
1657 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001658}
1659
1660class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001661 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001662 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001663 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001664}
1665
1666class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001667 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001668 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001669 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001670 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001671 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001672}
1673
1674class VkMemoryBarrier {
1675 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1676 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001677 VkAccessFlags srcAccessMask
1678 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001679}
1680
1681class VkBufferMemoryBarrier {
1682 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1683 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001684 VkAccessFlags srcAccessMask
1685 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001686 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001687 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001688 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001689 VkDeviceSize offset /// Offset within the buffer to sync
1690 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001691}
1692
1693class VkImageMemoryBarrier {
1694 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1695 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001696 VkAccessFlags srcAccessMask
1697 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001698 VkImageLayout oldLayout /// Current layout of the image
1699 VkImageLayout newLayout /// New layout to transition the image to
1700 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001701 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001702 VkImage image /// Image to sync
1703 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1704}
1705
1706class VkImageCreateInfo {
1707 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1708 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001709 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001710 VkImageType imageType
1711 VkFormat format
1712 VkExtent3D extent
1713 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001714 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001715 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001716 VkImageTiling tiling
1717 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001718 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001719 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001720 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001721 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001722}
1723
1724class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001725 VkDeviceSize offset /// Specified in bytes
1726 VkDeviceSize size /// Specified in bytes
1727 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001728 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001729 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001730}
1731
1732class VkImageViewCreateInfo {
1733 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1734 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001735 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001736 VkImage image
1737 VkImageViewType viewType
1738 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001739 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001740 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001741}
1742
1743class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001744 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001745 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001746 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001747}
1748
Jesse Halla6429252015-11-29 18:59:42 -08001749class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001750 VkDeviceSize resourceOffset /// Specified in bytes
1751 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001752 VkDeviceMemory memory
1753 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001754 VkSparseMemoryBindFlags flags
1755}
1756
Jesse Halla6429252015-11-29 18:59:42 -08001757class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001758 VkImageSubresource subresource
1759 VkOffset3D offset
1760 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001761 VkDeviceMemory memory
1762 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001763 VkSparseMemoryBindFlags flags
1764}
1765
Jesse Halla6429252015-11-29 18:59:42 -08001766class VkSparseBufferMemoryBindInfo {
1767 VkBuffer buffer
1768 u32 bindCount
1769 const VkSparseMemoryBind* pBinds
1770}
1771
1772class VkSparseImageOpaqueMemoryBindInfo {
1773 VkImage image
1774 u32 bindCount
1775 const VkSparseMemoryBind* pBinds
1776}
1777
1778class VkSparseImageMemoryBindInfo {
1779 VkImage image
1780 u32 bindCount
1781 const VkSparseMemoryBind* pBinds
1782}
1783
1784class VkBindSparseInfo {
1785 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1786 const void* pNext
1787 u32 waitSemaphoreCount
1788 const VkSemaphore* pWaitSemaphores
1789 u32 numBufferBinds
1790 const VkSparseBufferMemoryBindInfo* pBufferBinds
1791 u32 numImageOpaqueBinds
1792 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1793 u32 numImageBinds
1794 const VkSparseImageMemoryBindInfo* pImageBinds
1795 u32 signalSemaphoreCount
1796 const VkSemaphore* pSignalSemaphores
1797}
1798
Jesse Hall65ab5522015-11-30 00:07:16 -08001799class VkImageSubresourceLayers {
1800 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001801 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001802 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001803 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001804}
1805
Jesse Halld27f6aa2015-08-15 17:58:48 -07001806class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001807 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001808 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001809 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001810 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001811 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1812}
1813
1814class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001815 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001816 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08001817 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001818 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07001819}
1820
1821class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001822 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001823 u32 bufferRowLength /// Specified in texels
1824 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001825 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001826 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1827 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1828}
1829
1830class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001831 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001832 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001833 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001834 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001835 VkExtent3D extent
1836}
1837
1838class VkShaderModuleCreateInfo {
1839 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1840 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001841 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001842 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08001843 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07001844}
1845
Jesse Halld27f6aa2015-08-15 17:58:48 -07001846class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08001847 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001848 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08001849 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001850 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
1851 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
1852}
1853
1854class VkDescriptorSetLayoutCreateInfo {
1855 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
1856 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001857 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001858 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08001859 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001860}
1861
Jesse Hall65ab5522015-11-30 00:07:16 -08001862class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001863 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08001864 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001865}
1866
1867class VkDescriptorPoolCreateInfo {
1868 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
1869 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08001870 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001871 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08001872 u32 poolSizeCount
1873 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001874}
1875
Jesse Hall3fbc8562015-11-29 22:10:52 -08001876class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001877 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08001878 const void* pNext /// Pointer to next structure
1879 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08001880 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001881 const VkDescriptorSetLayout* pSetLayouts
1882}
1883
Jesse Halld27f6aa2015-08-15 17:58:48 -07001884class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08001885 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07001886 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08001887 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07001888}
1889
1890class VkSpecializationInfo {
1891 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08001892 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07001893 platform.size_t dataSize /// Size in bytes of pData
1894 const void* pData /// Pointer to SpecConstant data
1895}
1896
1897class VkPipelineShaderStageCreateInfo {
1898 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
1899 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001900 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001901 VkShaderStageFlagBits stage
1902 VkShaderModule module
1903 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07001904 const VkSpecializationInfo* pSpecializationInfo
1905}
1906
1907class VkComputePipelineCreateInfo {
1908 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
1909 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001910 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001911 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001912 VkPipelineLayout layout /// Interface layout of the pipeline
1913 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
1914 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
1915}
1916
1917class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001918 u32 binding /// Vertex buffer binding id
1919 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08001920 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07001921}
1922
1923class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001924 u32 location /// location of the shader vertex attrib
1925 u32 binding /// Vertex buffer binding id
1926 VkFormat format /// format of source data
1927 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001928}
1929
1930class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001931 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
1932 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001933 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001934 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001935 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08001936 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001937 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1938}
1939
1940class VkPipelineInputAssemblyStateCreateInfo {
1941 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
1942 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001943 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001944 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001945 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001946}
1947
1948class VkPipelineTessellationStateCreateInfo {
1949 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
1950 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001951 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001952 u32 patchControlPoints
1953}
1954
1955class VkPipelineViewportStateCreateInfo {
1956 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
1957 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001958 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001959 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001960 const VkViewport* pViewports
1961 u32 scissorCount
1962 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07001963}
1964
Jesse Hall3fbc8562015-11-29 22:10:52 -08001965class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08001966 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001967 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001968 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001969 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001970 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001971 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08001972 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07001973 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001974 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08001975 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001976 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08001977 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001978 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001979}
1980
1981class VkPipelineMultisampleStateCreateInfo {
1982 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
1983 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001984 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001985 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001986 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001987 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001988 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08001989 VkBool32 alphaToCoverageEnable
1990 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001991}
1992
1993class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001994 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001995 VkBlendFactor srcColorBlendFactor
1996 VkBlendFactor dstColorBlendFactor
1997 VkBlendOp colorBlendOp
1998 VkBlendFactor srcAlphaBlendFactor
1999 VkBlendFactor dstAlphaBlendFactor
2000 VkBlendOp alphaBlendOp
2001 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002002}
2003
2004class VkPipelineColorBlendStateCreateInfo {
2005 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2006 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002007 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002008 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002009 VkLogicOp logicOp
2010 u32 attachmentCount /// # of pAttachments
2011 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002012 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002013}
2014
2015class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002016 VkStencilOp failOp
2017 VkStencilOp passOp
2018 VkStencilOp depthFailOp
2019 VkCompareOp compareOp
2020 u32 compareMask
2021 u32 writeMask
2022 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002023}
2024
2025class VkPipelineDepthStencilStateCreateInfo {
2026 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2027 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002028 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002029 VkBool32 depthTestEnable
2030 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002031 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002032 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2033 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002034 VkStencilOpState front
2035 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002036 f32 minDepthBounds
2037 f32 maxDepthBounds
2038}
2039
2040class VkPipelineDynamicStateCreateInfo {
2041 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2042 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002043 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002044 u32 dynamicStateCount
2045 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002046}
2047
2048class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002049 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2050 const void* pNext /// Pointer to next structure
2051 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002052 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002053 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002054 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2055 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2056 const VkPipelineTessellationStateCreateInfo* pTessellationState
2057 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002058 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002059 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2060 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2061 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002062 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002063 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002064 VkRenderPass renderPass
2065 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002066 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
2067 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 -07002068}
2069
2070class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002071 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2072 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002073 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002074 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2075 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002076}
2077
2078class VkPushConstantRange {
2079 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002080 u32 offset /// Start of the range, in bytes
2081 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002082}
2083
2084class VkPipelineLayoutCreateInfo {
2085 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2086 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002087 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002088 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002089 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2090 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2091 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2092}
2093
2094class VkSamplerCreateInfo {
2095 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2096 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002097 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002098 VkFilter magFilter /// Filter mode for magnification
2099 VkFilter minFilter /// Filter mode for minifiation
2100 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2101 VkSamplerAddressMode addressModeU
2102 VkSamplerAddressMode addressModeV
2103 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002104 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002105 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002106 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002107 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002108 VkCompareOp compareOp
2109 f32 minLod
2110 f32 maxLod
2111 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002112 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002113}
2114
Jesse Hall3fbc8562015-11-29 22:10:52 -08002115class VkCommandPoolCreateInfo {
2116 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002117 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002118 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002119 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002120}
2121
Jesse Hall3fbc8562015-11-29 22:10:52 -08002122class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002123 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002124 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002125 VkCommandPool commandPool
2126 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002127 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002128}
2129
Jesse Hall3dd678a2016-01-08 21:52:01 -08002130class VkCommandBufferInheritanceInfo {
2131 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002132 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002133 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002134 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002135 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002136 VkBool32 occlusionQueryEnable
2137 VkQueryControlFlags queryFlags
2138 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002139}
2140
Jesse Hall3dd678a2016-01-08 21:52:01 -08002141class VkCommandBufferBeginInfo {
2142 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2143 const void* pNext /// Pointer to next structure
2144 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2145 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2146}
2147
Jesse Halld27f6aa2015-08-15 17:58:48 -07002148class VkRenderPassBeginInfo {
2149 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2150 const void* pNext /// Pointer to next structure
2151 VkRenderPass renderPass
2152 VkFramebuffer framebuffer
2153 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002154 u32 clearValueCount
2155 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002156}
2157
2158@union
2159/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2160class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002161 f32[4] float32
2162 s32[4] int32
2163 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002164}
2165
2166class VkClearDepthStencilValue {
2167 f32 depth
2168 u32 stencil
2169}
2170
2171@union
2172/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2173class VkClearValue {
2174 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002175 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002176}
2177
Jesse Hallae38f732015-11-19 21:32:50 -08002178class VkClearAttachment {
2179 VkImageAspectFlags aspectMask
2180 u32 colorAttachment
2181 VkClearValue clearValue
2182}
2183
Jesse Halld27f6aa2015-08-15 17:58:48 -07002184class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002185 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002186 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002187 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002188 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2189 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2190 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2191 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2192 VkImageLayout initialLayout
2193 VkImageLayout finalLayout
2194}
2195
2196class VkAttachmentReference {
2197 u32 attachment
2198 VkImageLayout layout
2199}
2200
2201class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002202 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002203 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002204 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002205 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002206 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002207 const VkAttachmentReference* pColorAttachments
2208 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002209 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002210 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002211 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002212}
2213
2214class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002215 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002216 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002217 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002218 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002219 VkAccessFlags srcAccessMask
2220 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002221 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002222}
2223
2224class VkRenderPassCreateInfo {
2225 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2226 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002227 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002228 u32 attachmentCount
2229 const VkAttachmentDescription* pAttachments
2230 u32 subpassCount
2231 const VkSubpassDescription* pSubpasses
2232 u32 dependencyCount
2233 const VkSubpassDependency* pDependencies
2234}
2235
2236class VkEventCreateInfo {
2237 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2238 const void* pNext /// Pointer to next structure
2239 VkEventCreateFlags flags /// Event creation flags
2240}
2241
2242class VkFenceCreateInfo {
2243 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2244 const void* pNext /// Pointer to next structure
2245 VkFenceCreateFlags flags /// Fence creation flags
2246}
2247
2248class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002249 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2250 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2251 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2252 VkBool32 independentBlend /// blending operations are controlled per-attachment
2253 VkBool32 geometryShader /// geometry stage
2254 VkBool32 tessellationShader /// tessellation control and evaluation stage
2255 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002256 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002257 VkBool32 logicOp /// logic operations
2258 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002259 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002260 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002261 VkBool32 depthBiasClamp /// depth bias clamping
2262 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2263 VkBool32 depthBounds /// depth bounds test
2264 VkBool32 wideLines /// lines with width greater than 1
2265 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002266 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2267 VkBool32 multiViewport
2268 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002269 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2270 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2271 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002272 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002273 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002274 VkBool32 vertexPipelineStoresAndAtomics
2275 VkBool32 fragmentStoresAndAtomics
2276 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002277 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2278 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2279 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002280 VkBool32 shaderStorageImageReadWithoutFormat
2281 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002282 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2283 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2284 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2285 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2286 VkBool32 shaderClipDistance /// clip distance in shaders
2287 VkBool32 shaderCullDistance /// cull distance in shaders
2288 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2289 VkBool32 shaderInt64 /// 64-bit integers in shaders
2290 VkBool32 shaderInt16 /// 16-bit integers in shaders
2291 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002292 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002293 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2294 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2295 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2296 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2297 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2298 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2299 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2300 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2301 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002302 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002303 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002304}
2305
2306class VkPhysicalDeviceLimits {
2307 /// resource maximum sizes
2308 u32 maxImageDimension1D /// max 1D image dimension
2309 u32 maxImageDimension2D /// max 2D image dimension
2310 u32 maxImageDimension3D /// max 3D image dimension
2311 u32 maxImageDimensionCube /// max cubemap image dimension
2312 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002313 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002314 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2315 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002316 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2317 /// memory limits
2318 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002319 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002320 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2321 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002322 /// descriptor set limits
2323 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002324 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2325 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2326 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2327 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2328 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002329 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002330 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002331 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2332 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002333 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002334 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002335 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002336 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2337 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002338 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002339 /// vertex stage limits
2340 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002341 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002342 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2343 u32 maxVertexInputBindingStride /// max vertex input binding stride
2344 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2345 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002346 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002347 u32 maxTessellationPatchSize /// max patch size (vertices)
2348 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2349 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2350 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2351 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2352 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2353 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002354 /// geometry stage limits
2355 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2356 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2357 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2358 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2359 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2360 /// fragment stage limits
2361 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002362 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002363 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002364 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2365 /// compute stage limits
2366 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2367 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2368 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2369 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2370
2371 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2372 u32 subTexelPrecisionBits /// num bits of subtexel precision
2373 u32 mipmapPrecisionBits /// num bits of mipmap precision
2374
2375 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002376 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002377
2378 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2379 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2380
2381 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002382 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2383 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2384 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2385
Jesse Halldc6d36c2015-11-29 19:12:15 -08002386 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2387 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2388 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2389 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002390
Jesse Hallfbf97b02015-11-20 14:17:03 -08002391 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002392 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002393 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002394 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2395 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2396 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2397 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2398
2399 u32 maxFramebufferWidth /// max width for a framebuffer
2400 u32 maxFramebufferHeight /// max height for a framebuffer
2401 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002402 VkSampleCountFlags framebufferColorSampleCounts
2403 VkSampleCountFlags framebufferDepthSampleCounts
2404 VkSampleCountFlags framebufferStencilSampleCounts
2405 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002406 u32 maxColorAttachments /// max num of framebuffer color attachments
2407
Jesse Hall091ed9e2015-11-30 00:55:29 -08002408 VkSampleCountFlags sampledImageColorSampleCounts
2409 VkSampleCountFlags sampledImageIntegerSampleCounts
2410 VkSampleCountFlags sampledImageDepthSampleCounts
2411 VkSampleCountFlags sampledImageStencilSampleCounts
2412 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002413 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002414 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002415
Jesse Halla9bb62b2015-11-21 19:31:56 -08002416 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002417
2418 u32 maxClipDistances /// max number of clip distances
2419 u32 maxCullDistances /// max number of cull distances
2420 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2421
Jesse Hallfbf97b02015-11-20 14:17:03 -08002422 u32 discreteQueuePriorities
2423
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002424 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2425 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002426 f32 pointSizeGranularity /// granularity of supported point sizes
2427 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002428 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002429 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002430
Jesse Hall65ab5522015-11-30 00:07:16 -08002431 VkDeviceSize optimalBufferCopyOffsetAlignment
2432 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002433 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002434}
2435
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002436class VkPhysicalDeviceSparseProperties {
2437 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 -08002438 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 -07002439 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2440 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 -07002441 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
2442}
2443
Jesse Halld27f6aa2015-08-15 17:58:48 -07002444class VkSemaphoreCreateInfo {
2445 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2446 const void* pNext /// Pointer to next structure
2447 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2448}
2449
2450class VkQueryPoolCreateInfo {
2451 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2452 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002453 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002454 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002455 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002456 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2457}
2458
2459class VkFramebufferCreateInfo {
2460 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2461 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002462 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002463 VkRenderPass renderPass
2464 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002465 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002466 u32 width
2467 u32 height
2468 u32 layers
2469}
2470
Jesse Hall3fbc8562015-11-29 22:10:52 -08002471class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002472 u32 vertexCount
2473 u32 instanceCount
2474 u32 firstVertex
2475 u32 firstInstance
2476}
2477
Jesse Hall3fbc8562015-11-29 22:10:52 -08002478class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002479 u32 indexCount
2480 u32 instanceCount
2481 u32 firstIndex
2482 s32 vertexOffset
2483 u32 firstInstance
2484}
2485
Jesse Hall3fbc8562015-11-29 22:10:52 -08002486class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002487 u32 x
2488 u32 y
2489 u32 z
2490}
2491
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002492@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002493class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002494 u32 minImageCount
2495 u32 maxImageCount
2496 VkExtent2D currentExtent
2497 VkExtent2D minImageExtent
2498 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002499 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002500 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002501 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002502 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002503 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002504}
2505
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002506@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002507class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002508 VkFormat format
2509 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002510}
2511
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002512@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002513class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002514 VkStructureType sType
2515 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002516 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002517 VkSurfaceKHR surface
2518 u32 minImageCount
2519 VkFormat imageFormat
2520 VkColorSpaceKHR imageColorSpace
2521 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002522 u32 imageArrayLayers
2523 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002524 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002525 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002526 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002527 VkSurfaceTransformFlagBitsKHR preTransform
2528 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002529 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002530 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002531 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002532}
2533
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002534@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002535class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002536 VkStructureType sType
2537 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002538 u32 waitSemaphoreCount
2539 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002540 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002541 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002542 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002543 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002544}
2545
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002546@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002547class VkDisplayPropertiesKHR {
2548 VkDisplayKHR display
2549 const char* displayName
2550 VkExtent2D physicalDimensions
2551 VkExtent2D physicalResolution
2552 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002553 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002554 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002555}
2556
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002557@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002558class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002559 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002560 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002561}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002562
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002563@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002564class VkDisplayModePropertiesKHR {
2565 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002566 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002567}
2568
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002569@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002570class VkDisplayModeCreateInfoKHR {
2571 VkStructureType sType
2572 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002573 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002574 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002575}
2576
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002577@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002578class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002579 VkDisplayKHR currentDisplay
2580 u32 currentStackIndex
2581}
2582
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002583@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002584class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002585 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2586 VkOffset2D minSrcPosition
2587 VkOffset2D maxSrcPosition
2588 VkExtent2D minSrcExtent
2589 VkExtent2D maxSrcExtent
2590 VkOffset2D minDstPosition
2591 VkOffset2D maxDstPosition
2592 VkExtent2D minDstExtent
2593 VkExtent2D maxDstExtent
2594}
2595
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002596@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002597class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002598 VkStructureType sType
2599 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002600 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002601 VkDisplayModeKHR displayMode
2602 u32 planeIndex
2603 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002604 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002605 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002606 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2607 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002608}
2609
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002610@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002611class VkDisplayPresentInfoKHR {
2612 VkStructureType sType
2613 const void* pNext
2614 VkRect2D srcRect
2615 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002616 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002617}
2618
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002619@extension("VK_KHR_xlib_surface")
2620class VkXlibSurfaceCreateInfoKHR {
2621 VkStructureType sType
2622 const void* pNext
2623 VkXlibSurfaceCreateFlagsKHR flags
2624 platform.Display* dpy
2625 platform.Window window
2626}
2627
2628@extension("VK_KHR_xcb_surface")
2629class VkXcbSurfaceCreateInfoKHR {
2630 VkStructureType sType
2631 const void* pNext
2632 VkXcbSurfaceCreateFlagsKHR flags
2633 platform.xcb_connection_t* connection
2634 platform.xcb_window_t window
2635}
2636
2637@extension("VK_KHR_wayland_surface")
2638class VkWaylandSurfaceCreateInfoKHR {
2639 VkStructureType sType
2640 const void* pNext
2641 VkWaylandSurfaceCreateFlagsKHR flags
2642 platform.wl_display* display
2643 platform.wl_surface* surface
2644}
2645
2646@extension("VK_KHR_mir_surface")
2647class VkMirSurfaceCreateInfoKHR {
2648 VkStructureType sType
2649 const void* pNext
2650 VkMirSurfaceCreateFlagsKHR flags
2651 platform.MirConnection* connection
2652 platform.MirSurface* mirSurface
2653}
2654
2655@extension("VK_KHR_android_surface")
2656class VkAndroidSurfaceCreateInfoKHR {
2657 VkStructureType sType
2658 const void* pNext
2659 VkAndroidSurfaceCreateFlagsKHR flags
2660 platform.ANativeWindow* window
2661}
2662
2663@extension("VK_KHR_win32_surface")
2664class VkWin32SurfaceCreateInfoKHR {
2665 VkStructureType sType
2666 const void* pNext
2667 VkWin32SurfaceCreateFlagsKHR flags
2668 platform.HINSTANCE hinstance
2669 platform.HWND hwnd
2670}
2671
Chia-I Wub262ddc2016-03-22 07:38:20 +08002672@extension("VK_ANDROID_native_buffer")
2673class VkNativeBufferANDROID {
2674 VkStructureType sType
2675 const void* pNext
2676 platform.buffer_handle_t handle
2677 int stride
2678 int format
2679 int usage
2680}
2681
Chris Forbes8e4438b2016-12-07 16:26:49 +13002682@extension("VK_ANDROID_native_buffer")
2683class VkSwapchainImageCreateInfoANDROID {
2684 VkStructureType sType
2685 const void* pNext
2686 VkSwapchainImageUsageFlagBitsANDROID flags
2687}
2688
Jesse Hall715b86a2016-01-16 16:34:29 -08002689@extension("VK_EXT_debug_report")
2690class VkDebugReportCallbackCreateInfoEXT {
2691 VkStructureType sType
2692 const void* pNext
2693 VkDebugReportFlagsEXT flags
2694 PFN_vkDebugReportCallbackEXT pfnCallback
2695 void* pUserData
2696}
2697
Jesse Hall26763382016-05-20 07:13:52 -07002698@extension("VK_AMD_rasterization_order")
2699class VkPipelineRasterizationStateRasterizationOrderAMD {
2700 VkStructureType sType
2701 const void* pNext
2702 VkRasterizationOrderAMD rasterizationOrder
2703}
2704
2705@extension("VK_EXT_debug_marker")
2706class VkDebugMarkerObjectNameInfoEXT {
2707 VkStructureType sType
2708 const void* pNext
2709 VkDebugReportObjectTypeEXT objectType
2710 u64 object
2711 const char* pObjectName
2712}
2713
2714@extension("VK_EXT_debug_marker")
2715class VkDebugMarkerObjectTagInfoEXT {
2716 VkStructureType sType
2717 const void* pNext
2718 VkDebugReportObjectTypeEXT objectType
2719 u64 object
2720 u64 tagName
2721 platform.size_t tagSize
2722 const void* pTag
2723}
2724
2725@extension("VK_EXT_debug_marker")
2726class VkDebugMarkerMarkerInfoEXT {
2727 VkStructureType sType
2728 const void* pNext
2729 const char* pMarkerName
2730 f32[4] color
2731}
2732
Jesse Hall56d386a2016-07-26 15:20:40 -07002733@extension("VK_NV_dedicated_allocation")
2734class VkDedicatedAllocationImageCreateInfoNV {
2735 VkStructureType sType
2736 const void* pNext
2737 VkBool32 dedicatedAllocation
2738}
2739
2740@extension("VK_NV_dedicated_allocation")
2741class VkDedicatedAllocationBufferCreateInfoNV {
2742 VkStructureType sType
2743 const void* pNext
2744 VkBool32 dedicatedAllocation
2745}
2746
2747@extension("VK_NV_dedicated_allocation")
2748class VkDedicatedAllocationMemoryAllocateInfoNV {
2749 VkStructureType sType
2750 const void* pNext
2751 VkImage image
2752 VkBuffer buffer
2753}
2754
Jesse Hall1356b0d2015-11-23 17:24:58 -08002755
Jesse Halld27f6aa2015-08-15 17:58:48 -07002756////////////////
2757// Commands //
2758////////////////
2759
2760// Function pointers. TODO: add support for function pointers.
2761
2762@external type void* PFN_vkVoidFunction
2763@pfn cmd void vkVoidFunction() {
2764}
2765
Jesse Hall3fbc8562015-11-29 22:10:52 -08002766@external type void* PFN_vkAllocationFunction
2767@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002768 void* pUserData,
2769 platform.size_t size,
2770 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002771 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002772 return ?
2773}
2774
Jesse Hall3fbc8562015-11-29 22:10:52 -08002775@external type void* PFN_vkReallocationFunction
2776@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002777 void* pUserData,
2778 void* pOriginal,
2779 platform.size_t size,
2780 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002781 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002782 return ?
2783}
2784
2785@external type void* PFN_vkFreeFunction
2786@pfn cmd void vkFreeFunction(
2787 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002788 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002789}
2790
Jesse Hall3fbc8562015-11-29 22:10:52 -08002791@external type void* PFN_vkInternalAllocationNotification
2792@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002793 void* pUserData,
2794 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002795 VkInternalAllocationType allocationType,
2796 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002797}
2798
2799@external type void* PFN_vkInternalFreeNotification
2800@pfn cmd void vkInternalFreeNotification(
2801 void* pUserData,
2802 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002803 VkInternalAllocationType allocationType,
2804 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002805}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002806
2807// Global functions
2808
2809@threadSafety("system")
2810cmd VkResult vkCreateInstance(
2811 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002812 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002813 VkInstance* pInstance) {
2814 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
2815
2816 instance := ?
2817 pInstance[0] = instance
2818 State.Instances[instance] = new!InstanceObject()
2819
Jesse Hall3dd678a2016-01-08 21:52:01 -08002820 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
2821 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07002822
2823 return ?
2824}
2825
2826@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002827cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002828 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002829 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002830 instanceObject := GetInstance(instance)
2831
2832 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002833}
2834
2835@threadSafety("system")
2836cmd VkResult vkEnumeratePhysicalDevices(
2837 VkInstance instance,
2838 u32* pPhysicalDeviceCount,
2839 VkPhysicalDevice* pPhysicalDevices) {
2840 instanceObject := GetInstance(instance)
2841
2842 physicalDeviceCount := as!u32(?)
2843 pPhysicalDeviceCount[0] = physicalDeviceCount
2844 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
2845
2846 for i in (0 .. physicalDeviceCount) {
2847 physicalDevice := ?
2848 physicalDevices[i] = physicalDevice
2849 if !(physicalDevice in State.PhysicalDevices) {
2850 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
2851 }
2852 }
2853
2854 return ?
2855}
2856
2857cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
2858 VkDevice device,
2859 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002860 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002861 device := GetDevice(device)
2862 }
2863
2864 return ?
2865}
2866
2867cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
2868 VkInstance instance,
2869 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002870 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002871 instanceObject := GetInstance(instance)
2872 }
2873
2874 return ?
2875}
2876
Jesse Hall606a54e2015-11-19 22:17:28 -08002877cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002878 VkPhysicalDevice physicalDevice,
2879 VkPhysicalDeviceProperties* pProperties) {
2880 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2881
2882 properties := ?
2883 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002884}
2885
Jesse Hall606a54e2015-11-19 22:17:28 -08002886cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002887 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002888 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002889 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002890 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002891 // TODO: Figure out how to express fetch-count-or-properties
2892 // This version fails 'apic validate' with 'fence not allowed in
2893 // *semantic.Branch'. Other attempts have failed with the same or other
2894 // errors.
2895 // if pQueueFamilyProperties != null {
2896 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
2897 // for i in (0 .. pCount[0]) {
2898 // queueProperties := as!VkQueueFamilyProperties(?)
2899 // queuesProperties[i] = queueProperties
2900 // }
2901 // } else {
2902 // count := ?
2903 // pCount[0] = count
2904 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002905}
2906
Jesse Hall606a54e2015-11-19 22:17:28 -08002907cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002908 VkPhysicalDevice physicalDevice,
2909 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
2910 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2911
2912 memoryProperties := ?
2913 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002914}
2915
Jesse Hall606a54e2015-11-19 22:17:28 -08002916cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002917 VkPhysicalDevice physicalDevice,
2918 VkPhysicalDeviceFeatures* pFeatures) {
2919 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2920
2921 features := ?
2922 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07002923}
2924
Jesse Hall606a54e2015-11-19 22:17:28 -08002925cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002926 VkPhysicalDevice physicalDevice,
2927 VkFormat format,
2928 VkFormatProperties* pFormatProperties) {
2929 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2930
2931 formatProperties := ?
2932 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002933}
2934
Jesse Halla9e57032015-11-30 01:03:10 -08002935cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002936 VkPhysicalDevice physicalDevice,
2937 VkFormat format,
2938 VkImageType type,
2939 VkImageTiling tiling,
2940 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002941 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002942 VkImageFormatProperties* pImageFormatProperties) {
2943 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2944
2945 imageFormatProperties := ?
2946 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08002947
2948 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07002949}
2950
Jesse Halld27f6aa2015-08-15 17:58:48 -07002951
2952// Device functions
2953
2954@threadSafety("system")
2955cmd VkResult vkCreateDevice(
2956 VkPhysicalDevice physicalDevice,
2957 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002958 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002959 VkDevice* pDevice) {
2960 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
2961 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2962
2963 device := ?
2964 pDevice[0] = device
2965 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
2966
2967 return ?
2968}
2969
2970@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002971cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002972 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002973 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002974 deviceObject := GetDevice(device)
2975
2976 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002977}
2978
2979
2980// Extension discovery functions
2981
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002982cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002983 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002984 VkLayerProperties* pProperties) {
2985 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002986 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002987
2988 properties := pProperties[0:count]
2989 for i in (0 .. count) {
2990 property := ?
2991 properties[i] = property
2992 }
2993
2994 return ?
2995}
2996
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002997cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002998 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002999 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003000 VkExtensionProperties* pProperties) {
3001 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003002 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003003
3004 properties := pProperties[0:count]
3005 for i in (0 .. count) {
3006 property := ?
3007 properties[i] = property
3008 }
3009
3010 return ?
3011}
3012
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003013cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003014 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003015 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003016 VkLayerProperties* pProperties) {
3017 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3018 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003019 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003020
3021 properties := pProperties[0:count]
3022 for i in (0 .. count) {
3023 property := ?
3024 properties[i] = property
3025 }
3026
3027 return ?
3028}
3029
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003030cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003031 VkPhysicalDevice physicalDevice,
3032 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003033 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003034 VkExtensionProperties* pProperties) {
3035 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3036
3037 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003038 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003039
3040 properties := pProperties[0:count]
3041 for i in (0 .. count) {
3042 property := ?
3043 properties[i] = property
3044 }
3045
3046 return ?
3047}
3048
3049
3050// Queue functions
3051
3052@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003053cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003054 VkDevice device,
3055 u32 queueFamilyIndex,
3056 u32 queueIndex,
3057 VkQueue* pQueue) {
3058 deviceObject := GetDevice(device)
3059
3060 queue := ?
3061 pQueue[0] = queue
3062
3063 if !(queue in State.Queues) {
3064 State.Queues[queue] = new!QueueObject(device: device)
3065 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003066}
3067
3068@threadSafety("app")
3069cmd VkResult vkQueueSubmit(
3070 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003071 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003072 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003073 VkFence fence) {
3074 queueObject := GetQueue(queue)
3075
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003076 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003077 fenceObject := GetFence(fence)
3078 assert(fenceObject.device == queueObject.device)
3079 }
3080
Jesse Hall3fbc8562015-11-29 22:10:52 -08003081 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3082 // for i in (0 .. commandBufferCount) {
3083 // commandBuffer := commandBuffers[i]
3084 // commandBufferObject := GetCommandBuffer(commandBuffer)
3085 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003086 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003087 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3088 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003089 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003090
3091 return ?
3092}
3093
3094@threadSafety("system")
3095cmd VkResult vkQueueWaitIdle(
3096 VkQueue queue) {
3097 queueObject := GetQueue(queue)
3098
3099 return ?
3100}
3101
3102@threadSafety("system")
3103cmd VkResult vkDeviceWaitIdle(
3104 VkDevice device) {
3105 deviceObject := GetDevice(device)
3106
3107 return ?
3108}
3109
3110
3111// Memory functions
3112
3113@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003114cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003115 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003116 const VkMemoryAllocateInfo* pAllocateInfo,
3117 const VkAllocationCallbacks* pAllocator,
3118 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003119 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003120 deviceObject := GetDevice(device)
3121
Jesse Hall3fbc8562015-11-29 22:10:52 -08003122 memory := ?
3123 pMemory[0] = memory
3124 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003125 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003126 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003127
3128 return ?
3129}
3130
3131@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003132cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003133 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003134 VkDeviceMemory memory,
3135 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003136 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003137 memoryObject := GetDeviceMemory(memory)
3138 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003139
3140 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003141 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003142 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003143 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3144 "vkFreeMemory: commandBuffers still bound")
3145 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003146}
3147
3148@threadSafety("app")
3149cmd VkResult vkMapMemory(
3150 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003151 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003152 VkDeviceSize offset,
3153 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003154 VkMemoryMapFlags flags,
3155 void** ppData) {
3156 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003157 memoryObject := GetDeviceMemory(memory)
3158 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003159
3160 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003161 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003162
3163 return ?
3164}
3165
3166@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003167cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003168 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003169 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003170 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003171 memoryObject := GetDeviceMemory(memory)
3172 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003173}
3174
3175cmd VkResult vkFlushMappedMemoryRanges(
3176 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003177 u32 memoryRangeCount
3178 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003179 deviceObject := GetDevice(device)
3180
Jesse Hall3fbc8562015-11-29 22:10:52 -08003181 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3182 for i in (0 .. memoryRangeCount) {
3183 memoryRange := memoryRanges[i]
3184 memoryObject := GetDeviceMemory(memoryRange.memory)
3185 assert(memoryObject.device == device)
3186 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003187 }
3188
3189 return ?
3190}
3191
3192cmd VkResult vkInvalidateMappedMemoryRanges(
3193 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003194 u32 memoryRangeCount,
3195 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003196 deviceObject := GetDevice(device)
3197
Jesse Hall3fbc8562015-11-29 22:10:52 -08003198 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3199 for i in (0 .. memoryRangeCount) {
3200 memoryRange := memoryRanges[i]
3201 memoryObject := GetDeviceMemory(memoryRange.memory)
3202 assert(memoryObject.device == device)
3203 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003204 }
3205
3206 return ?
3207}
3208
3209
3210// Memory management API functions
3211
Jesse Hall606a54e2015-11-19 22:17:28 -08003212cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003213 VkDevice device,
3214 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003215 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003216 deviceObject := GetDevice(device)
3217
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003218 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003219 memoryObject := GetDeviceMemory(memory)
3220 assert(memoryObject.device == device)
3221 }
3222
3223 committedMemoryInBytes := ?
3224 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003225}
3226
Jesse Hall606a54e2015-11-19 22:17:28 -08003227cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003228 VkDevice device,
3229 VkBuffer buffer,
3230 VkMemoryRequirements* pMemoryRequirements) {
3231 deviceObject := GetDevice(device)
3232 bufferObject := GetBuffer(buffer)
3233 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003234}
3235
3236cmd VkResult vkBindBufferMemory(
3237 VkDevice device,
3238 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003239 VkDeviceMemory memory,
3240 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003241 deviceObject := GetDevice(device)
3242 bufferObject := GetBuffer(buffer)
3243 assert(bufferObject.device == device)
3244
3245 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003246 if bufferObject.memory != NULL_HANDLE {
3247 memoryObject := GetDeviceMemory(bufferObject.memory)
3248 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003249 }
3250
3251 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003252 if memory != NULL_HANDLE {
3253 memoryObject := GetDeviceMemory(memory)
3254 assert(memoryObject.device == device)
3255 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003256 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003257 bufferObject.memory = memory
3258 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003259
3260 return ?
3261}
3262
Jesse Hall606a54e2015-11-19 22:17:28 -08003263cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003264 VkDevice device,
3265 VkImage image,
3266 VkMemoryRequirements* pMemoryRequirements) {
3267 deviceObject := GetDevice(device)
3268 imageObject := GetImage(image)
3269 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003270}
3271
3272cmd VkResult vkBindImageMemory(
3273 VkDevice device,
3274 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003275 VkDeviceMemory memory,
3276 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003277 deviceObject := GetDevice(device)
3278 imageObject := GetImage(image)
3279 assert(imageObject.device == device)
3280
3281 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003282 if imageObject.memory != NULL_HANDLE {
3283 memoryObject := GetDeviceMemory(imageObject.memory)
3284 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003285 }
3286
3287 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003288 if memory != NULL_HANDLE {
3289 memoryObject := GetDeviceMemory(memory)
3290 assert(memoryObject.device == device)
3291 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003292 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003293 imageObject.memory = memory
3294 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003295
3296 return ?
3297}
3298
Jesse Hall606a54e2015-11-19 22:17:28 -08003299cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003300 VkDevice device,
3301 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003302 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003303 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3304 deviceObject := GetDevice(device)
3305 imageObject := GetImage(image)
3306 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003307}
3308
Jesse Hall606a54e2015-11-19 22:17:28 -08003309cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003310 VkPhysicalDevice physicalDevice,
3311 VkFormat format,
3312 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003313 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003314 VkImageUsageFlags usage,
3315 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003316 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003317 VkSparseImageFormatProperties* pProperties) {
3318 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003319}
3320
Jesse Halla6429252015-11-29 18:59:42 -08003321cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003322 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003323 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003324 const VkBindSparseInfo* pBindInfo,
3325 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003326 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003327
3328 return ?
3329}
3330
3331
3332// Fence functions
3333
3334@threadSafety("system")
3335cmd VkResult vkCreateFence(
3336 VkDevice device,
3337 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003338 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003339 VkFence* pFence) {
3340 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3341 deviceObject := GetDevice(device)
3342
3343 fence := ?
3344 pFence[0] = fence
3345 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003346 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003347
3348 return ?
3349}
3350
3351@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003352cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003353 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003354 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003355 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003356 deviceObject := GetDevice(device)
3357 fenceObject := GetFence(fence)
3358 assert(fenceObject.device == device)
3359
3360 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003361}
3362
3363@threadSafety("system")
3364cmd VkResult vkResetFences(
3365 VkDevice device,
3366 u32 fenceCount,
3367 const VkFence* pFences) {
3368 deviceObject := GetDevice(device)
3369
3370 fences := pFences[0:fenceCount]
3371 for i in (0 .. fenceCount) {
3372 fence := fences[i]
3373 fenceObject := GetFence(fence)
3374 assert(fenceObject.device == device)
3375 fenceObject.signaled = false
3376 }
3377
3378 return ?
3379}
3380
3381@threadSafety("system")
3382cmd VkResult vkGetFenceStatus(
3383 VkDevice device,
3384 VkFence fence) {
3385 deviceObject := GetDevice(device)
3386 fenceObject := GetFence(fence)
3387 assert(fenceObject.device == device)
3388
3389 return ?
3390}
3391
3392@threadSafety("system")
3393cmd VkResult vkWaitForFences(
3394 VkDevice device,
3395 u32 fenceCount,
3396 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003397 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003398 u64 timeout) { /// timeout in nanoseconds
3399 deviceObject := GetDevice(device)
3400
3401 fences := pFences[0:fenceCount]
3402 for i in (0 .. fenceCount) {
3403 fence := fences[i]
3404 fenceObject := GetFence(fence)
3405 assert(fenceObject.device == device)
3406 }
3407
3408 return ?
3409}
3410
3411
3412// Queue semaphore functions
3413
3414@threadSafety("system")
3415cmd VkResult vkCreateSemaphore(
3416 VkDevice device,
3417 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003418 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003419 VkSemaphore* pSemaphore) {
3420 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3421 deviceObject := GetDevice(device)
3422
3423 semaphore := ?
3424 pSemaphore[0] = semaphore
3425 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3426
3427 return ?
3428}
3429
3430@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003431cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003432 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003433 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003434 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003435 deviceObject := GetDevice(device)
3436 semaphoreObject := GetSemaphore(semaphore)
3437 assert(semaphoreObject.device == device)
3438
3439 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003440}
3441
Jesse Halld27f6aa2015-08-15 17:58:48 -07003442
3443// Event functions
3444
3445@threadSafety("system")
3446cmd VkResult vkCreateEvent(
3447 VkDevice device,
3448 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003449 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003450 VkEvent* pEvent) {
3451 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3452 deviceObject := GetDevice(device)
3453
3454 event := ?
3455 pEvent[0] = event
3456 State.Events[event] = new!EventObject(device: device)
3457
3458 return ?
3459}
3460
3461@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003462cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003463 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003464 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003465 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003466 deviceObject := GetDevice(device)
3467 eventObject := GetEvent(event)
3468 assert(eventObject.device == device)
3469
3470 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003471}
3472
3473@threadSafety("system")
3474cmd VkResult vkGetEventStatus(
3475 VkDevice device,
3476 VkEvent event) {
3477 deviceObject := GetDevice(device)
3478 eventObject := GetEvent(event)
3479 assert(eventObject.device == device)
3480
3481 return ?
3482}
3483
3484@threadSafety("system")
3485cmd VkResult vkSetEvent(
3486 VkDevice device,
3487 VkEvent event) {
3488 deviceObject := GetDevice(device)
3489 eventObject := GetEvent(event)
3490 assert(eventObject.device == device)
3491
3492 return ?
3493}
3494
3495@threadSafety("system")
3496cmd VkResult vkResetEvent(
3497 VkDevice device,
3498 VkEvent event) {
3499 deviceObject := GetDevice(device)
3500 eventObject := GetEvent(event)
3501 assert(eventObject.device == device)
3502
3503 return ?
3504}
3505
3506
3507// Query functions
3508
3509@threadSafety("system")
3510cmd VkResult vkCreateQueryPool(
3511 VkDevice device,
3512 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003513 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003514 VkQueryPool* pQueryPool) {
3515 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3516 deviceObject := GetDevice(device)
3517
3518 queryPool := ?
3519 pQueryPool[0] = queryPool
3520 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3521
3522 return ?
3523}
3524
3525@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003526cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003527 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003528 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003529 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003530 deviceObject := GetDevice(device)
3531 queryPoolObject := GetQueryPool(queryPool)
3532 assert(queryPoolObject.device == device)
3533
3534 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003535}
3536
3537@threadSafety("system")
3538cmd VkResult vkGetQueryPoolResults(
3539 VkDevice device,
3540 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003541 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003542 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003543 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003544 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003545 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003546 VkQueryResultFlags flags) {
3547 deviceObject := GetDevice(device)
3548 queryPoolObject := GetQueryPool(queryPool)
3549 assert(queryPoolObject.device == device)
3550
Jesse Halld27f6aa2015-08-15 17:58:48 -07003551 data := pData[0:dataSize]
3552
3553 return ?
3554}
3555
3556// Buffer functions
3557
3558@threadSafety("system")
3559cmd VkResult vkCreateBuffer(
3560 VkDevice device,
3561 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003562 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003563 VkBuffer* pBuffer) {
3564 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3565 deviceObject := GetDevice(device)
3566
3567 buffer := ?
3568 pBuffer[0] = buffer
3569 State.Buffers[buffer] = new!BufferObject(device: device)
3570
3571 return ?
3572}
3573
3574@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003575cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003576 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003577 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003578 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003579 deviceObject := GetDevice(device)
3580 bufferObject := GetBuffer(buffer)
3581 assert(bufferObject.device == device)
3582
Jesse Hall3fbc8562015-11-29 22:10:52 -08003583 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003584 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003585}
3586
3587
3588// Buffer view functions
3589
3590@threadSafety("system")
3591cmd VkResult vkCreateBufferView(
3592 VkDevice device,
3593 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003594 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003595 VkBufferView* pView) {
3596 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3597 deviceObject := GetDevice(device)
3598
3599 bufferObject := GetBuffer(pCreateInfo.buffer)
3600 assert(bufferObject.device == device)
3601
3602 view := ?
3603 pView[0] = view
3604 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3605
3606 return ?
3607}
3608
3609@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003610cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003611 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003612 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003613 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003614 deviceObject := GetDevice(device)
3615 bufferViewObject := GetBufferView(bufferView)
3616 assert(bufferViewObject.device == device)
3617
3618 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003619}
3620
3621
3622// Image functions
3623
3624@threadSafety("system")
3625cmd VkResult vkCreateImage(
3626 VkDevice device,
3627 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003628 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003629 VkImage* pImage) {
3630 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3631 deviceObject := GetDevice(device)
3632
3633 image := ?
3634 pImage[0] = image
3635 State.Images[image] = new!ImageObject(device: device)
3636
3637 return ?
3638}
3639
3640@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003641cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003642 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003643 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003644 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003645 deviceObject := GetDevice(device)
3646 imageObject := GetImage(image)
3647 assert(imageObject.device == device)
3648
Jesse Hall3fbc8562015-11-29 22:10:52 -08003649 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003650 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003651}
3652
Jesse Hall606a54e2015-11-19 22:17:28 -08003653cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003654 VkDevice device,
3655 VkImage image,
3656 const VkImageSubresource* pSubresource,
3657 VkSubresourceLayout* pLayout) {
3658 deviceObject := GetDevice(device)
3659 imageObject := GetImage(image)
3660 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003661}
3662
3663
3664// Image view functions
3665
3666@threadSafety("system")
3667cmd VkResult vkCreateImageView(
3668 VkDevice device,
3669 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003670 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003671 VkImageView* pView) {
3672 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
3673 deviceObject := GetDevice(device)
3674
3675 imageObject := GetImage(pCreateInfo.image)
3676 assert(imageObject.device == device)
3677
3678 view := ?
3679 pView[0] = view
3680 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
3681
3682 return ?
3683}
3684
3685@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003686cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003687 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003688 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003689 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003690 deviceObject := GetDevice(device)
3691 imageViewObject := GetImageView(imageView)
3692 assert(imageViewObject.device == device)
3693
3694 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003695}
3696
3697
3698// Shader functions
3699
3700cmd VkResult vkCreateShaderModule(
3701 VkDevice device,
3702 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003703 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003704 VkShaderModule* pShaderModule) {
3705 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
3706 deviceObject := GetDevice(device)
3707
3708 shaderModule := ?
3709 pShaderModule[0] = shaderModule
3710 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
3711
3712 return ?
3713}
3714
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003715cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003716 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003717 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003718 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003719 deviceObject := GetDevice(device)
3720 shaderModuleObject := GetShaderModule(shaderModule)
3721 assert(shaderModuleObject.device == device)
3722
3723 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003724}
3725
Jesse Halld27f6aa2015-08-15 17:58:48 -07003726
3727// Pipeline functions
3728
3729cmd VkResult vkCreatePipelineCache(
3730 VkDevice device,
3731 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003732 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003733 VkPipelineCache* pPipelineCache) {
3734 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
3735 deviceObject := GetDevice(device)
3736
3737 pipelineCache := ?
3738 pPipelineCache[0] = pipelineCache
3739 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
3740
3741 return ?
3742}
3743
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003744cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003745 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003746 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003747 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003748 deviceObject := GetDevice(device)
3749 pipelineCacheObject := GetPipelineCache(pipelineCache)
3750 assert(pipelineCacheObject.device == device)
3751
3752 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003753}
3754
Jesse Halld27f6aa2015-08-15 17:58:48 -07003755cmd VkResult vkGetPipelineCacheData(
3756 VkDevice device,
3757 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003758 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003759 void* pData) {
3760 deviceObject := GetDevice(device)
3761 pipelineCacheObject := GetPipelineCache(pipelineCache)
3762 assert(pipelineCacheObject.device == device)
3763
3764 return ?
3765}
3766
3767cmd VkResult vkMergePipelineCaches(
3768 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003769 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003770 u32 srcCacheCount,
3771 const VkPipelineCache* pSrcCaches) {
3772 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003773 dstCacheObject := GetPipelineCache(dstCache)
3774 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003775
3776 srcCaches := pSrcCaches[0:srcCacheCount]
3777 for i in (0 .. srcCacheCount) {
3778 srcCache := srcCaches[i]
3779 srcCacheObject := GetPipelineCache(srcCache)
3780 assert(srcCacheObject.device == device)
3781 }
3782
3783 return ?
3784}
3785
3786cmd VkResult vkCreateGraphicsPipelines(
3787 VkDevice device,
3788 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003789 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003790 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003791 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003792 VkPipeline* pPipelines) {
3793 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003794 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003795 pipelineCacheObject := GetPipelineCache(pipelineCache)
3796 assert(pipelineCacheObject.device == device)
3797 }
3798
Jesse Hall03b6fe12015-11-24 12:44:21 -08003799 createInfos := pCreateInfos[0:createInfoCount]
3800 pipelines := pPipelines[0:createInfoCount]
3801 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003802 pipeline := ?
3803 pipelines[i] = pipeline
3804 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3805 }
3806
3807 return ?
3808}
3809
3810cmd VkResult vkCreateComputePipelines(
3811 VkDevice device,
3812 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003813 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003814 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003815 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003816 VkPipeline* pPipelines) {
3817 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003818 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003819 pipelineCacheObject := GetPipelineCache(pipelineCache)
3820 assert(pipelineCacheObject.device == device)
3821 }
3822
Jesse Hall03b6fe12015-11-24 12:44:21 -08003823 createInfos := pCreateInfos[0:createInfoCount]
3824 pipelines := pPipelines[0:createInfoCount]
3825 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003826 pipeline := ?
3827 pipelines[i] = pipeline
3828 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3829 }
3830
3831 return ?
3832}
3833
3834@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003835cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003836 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003837 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003838 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003839 deviceObject := GetDevice(device)
3840 pipelineObjects := GetPipeline(pipeline)
3841 assert(pipelineObjects.device == device)
3842
3843 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003844}
3845
3846
3847// Pipeline layout functions
3848
3849@threadSafety("system")
3850cmd VkResult vkCreatePipelineLayout(
3851 VkDevice device,
3852 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003853 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003854 VkPipelineLayout* pPipelineLayout) {
3855 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
3856 deviceObject := GetDevice(device)
3857
3858 pipelineLayout := ?
3859 pPipelineLayout[0] = pipelineLayout
3860 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
3861
3862 return ?
3863}
3864
3865@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003866cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003867 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003868 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003869 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003870 deviceObject := GetDevice(device)
3871 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
3872 assert(pipelineLayoutObjects.device == device)
3873
3874 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003875}
3876
3877
3878// Sampler functions
3879
3880@threadSafety("system")
3881cmd VkResult vkCreateSampler(
3882 VkDevice device,
3883 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003884 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003885 VkSampler* pSampler) {
3886 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
3887 deviceObject := GetDevice(device)
3888
3889 sampler := ?
3890 pSampler[0] = sampler
3891 State.Samplers[sampler] = new!SamplerObject(device: device)
3892
3893 return ?
3894}
3895
3896@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003897cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003898 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003899 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003900 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003901 deviceObject := GetDevice(device)
3902 samplerObject := GetSampler(sampler)
3903 assert(samplerObject.device == device)
3904
3905 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003906}
3907
3908
3909// Descriptor set functions
3910
3911@threadSafety("system")
3912cmd VkResult vkCreateDescriptorSetLayout(
3913 VkDevice device,
3914 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003915 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003916 VkDescriptorSetLayout* pSetLayout) {
3917 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
3918 deviceObject := GetDevice(device)
3919
3920 setLayout := ?
3921 pSetLayout[0] = setLayout
3922 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
3923
3924 return ?
3925}
3926
3927@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003928cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003929 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003930 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003931 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003932 deviceObject := GetDevice(device)
3933 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
3934 assert(descriptorSetLayoutObject.device == device)
3935
3936 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003937}
3938
3939@threadSafety("system")
3940cmd VkResult vkCreateDescriptorPool(
3941 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003942 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003943 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003944 VkDescriptorPool* pDescriptorPool) {
3945 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
3946 deviceObject := GetDevice(device)
3947
3948 descriptorPool := ?
3949 pDescriptorPool[0] = descriptorPool
3950 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
3951
3952 return ?
3953}
3954
3955@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003956cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003957 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003958 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003959 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003960 deviceObject := GetDevice(device)
3961 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3962 assert(descriptorPoolObject.device == device)
3963
3964 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003965}
3966
3967@threadSafety("app")
3968cmd VkResult vkResetDescriptorPool(
3969 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08003970 VkDescriptorPool descriptorPool,
3971 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003972 deviceObject := GetDevice(device)
3973 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3974 assert(descriptorPoolObject.device == device)
3975
3976 return ?
3977}
3978
3979@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003980cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003981 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003982 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003983 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003984 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003985 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003986 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003987
Jesse Hall03b6fe12015-11-24 12:44:21 -08003988 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
3989 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003990 setLayout := setLayouts[i]
3991 setLayoutObject := GetDescriptorSetLayout(setLayout)
3992 assert(setLayoutObject.device == device)
3993 }
3994
Jesse Hall03b6fe12015-11-24 12:44:21 -08003995 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
3996 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003997 descriptorSet := ?
3998 descriptorSets[i] = descriptorSet
3999 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4000 }
4001
4002 return ?
4003}
4004
Jesse Hallf09c6b12015-08-15 19:54:28 -07004005cmd VkResult vkFreeDescriptorSets(
4006 VkDevice device,
4007 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004008 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004009 const VkDescriptorSet* pDescriptorSets) {
4010 deviceObject := GetDevice(device)
4011 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4012
Jesse Hall03b6fe12015-11-24 12:44:21 -08004013 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4014 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004015 descriptorSet := descriptorSets[i]
4016 descriptorSetObject := GetDescriptorSet(descriptorSet)
4017 assert(descriptorSetObject.device == device)
4018 State.DescriptorSets[descriptorSet] = null
4019 }
4020
4021 return ?
4022}
4023
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004024cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004025 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004026 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004027 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004028 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004029 const VkCopyDescriptorSet* pDescriptorCopies) {
4030 deviceObject := GetDevice(device)
4031
Jesse Hallb00daad2015-11-29 19:46:20 -08004032 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4033 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004034 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004035 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004036 assert(descriptorWriteObject.device == device)
4037 }
4038
Jesse Hallb00daad2015-11-29 19:46:20 -08004039 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4040 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004041 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004042 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004043 assert(descriptorCopyObject.device == device)
4044 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004045}
4046
4047
4048// Framebuffer functions
4049
4050@threadSafety("system")
4051cmd VkResult vkCreateFramebuffer(
4052 VkDevice device,
4053 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004054 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004055 VkFramebuffer* pFramebuffer) {
4056 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4057 deviceObject := GetDevice(device)
4058
4059 framebuffer := ?
4060 pFramebuffer[0] = framebuffer
4061 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4062
4063 return ?
4064}
4065
4066@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004067cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004068 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004069 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004070 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004071 deviceObject := GetDevice(device)
4072 framebufferObject := GetFramebuffer(framebuffer)
4073 assert(framebufferObject.device == device)
4074
4075 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004076}
4077
4078
4079// Renderpass functions
4080
4081@threadSafety("system")
4082cmd VkResult vkCreateRenderPass(
4083 VkDevice device,
4084 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004085 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004086 VkRenderPass* pRenderPass) {
4087 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4088 deviceObject := GetDevice(device)
4089
4090 renderpass := ?
4091 pRenderPass[0] = renderpass
4092 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4093
4094 return ?
4095}
4096
4097@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004098cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004099 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004100 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004101 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004102 deviceObject := GetDevice(device)
4103 renderPassObject := GetRenderPass(renderPass)
4104 assert(renderPassObject.device == device)
4105
4106 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004107}
4108
Jesse Hall606a54e2015-11-19 22:17:28 -08004109cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004110 VkDevice device,
4111 VkRenderPass renderPass,
4112 VkExtent2D* pGranularity) {
4113 deviceObject := GetDevice(device)
4114 renderPassObject := GetRenderPass(renderPass)
4115
4116 granularity := ?
4117 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004118}
4119
4120// Command pool functions
4121
4122cmd VkResult vkCreateCommandPool(
4123 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004124 const VkCommandPoolCreateInfo* pCreateInfo,
4125 const VkAllocationCallbacks* pAllocator,
4126 VkCommandPool* pCommandPool) {
4127 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004128 deviceObject := GetDevice(device)
4129
Jesse Hall3fbc8562015-11-29 22:10:52 -08004130 commandPool := ?
4131 pCommandPool[0] = commandPool
4132 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004133
4134 return ?
4135}
4136
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004137cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004138 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004139 VkCommandPool commandPool,
4140 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004141 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004142 commandPoolObject := GetCommandPool(commandPool)
4143 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004144
Jesse Hall3fbc8562015-11-29 22:10:52 -08004145 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004146}
4147
4148cmd VkResult vkResetCommandPool(
4149 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004150 VkCommandPool commandPool,
4151 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004152 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004153 commandPoolObject := GetCommandPool(commandPool)
4154 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004155
4156 return ?
4157}
4158
4159// Command buffer functions
4160
Jesse Hall3fbc8562015-11-29 22:10:52 -08004161macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4162 memoryObject := GetDeviceMemory(memory)
4163 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004164
Jesse Hall3fbc8562015-11-29 22:10:52 -08004165 commandBufferObject := GetCommandBuffer(commandBuffer)
4166 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004167}
4168
Jesse Hall3fbc8562015-11-29 22:10:52 -08004169macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4170 memoryObject := GetDeviceMemory(memory)
4171 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004172
Jesse Hall3fbc8562015-11-29 22:10:52 -08004173 commandBufferObject := GetCommandBuffer(commandBuffer)
4174 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004175}
4176
4177@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004178cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004179 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004180 const VkCommandBufferAllocateInfo* pAllocateInfo,
4181 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004182 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004183
Jesse Hall3dd678a2016-01-08 21:52:01 -08004184 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004185 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004186 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004187 commandBuffer := ?
4188 commandBuffers[i] = commandBuffer
4189 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004190 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004191
4192 return ?
4193}
4194
4195@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004196cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004197 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004198 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004199 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004200 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004201 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004202
Jesse Hall3fbc8562015-11-29 22:10:52 -08004203 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004204 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004205 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4206 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004207 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004208 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004209 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004210}
4211
4212@threadSafety("app")
4213cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004214 VkCommandBuffer commandBuffer,
4215 const VkCommandBufferBeginInfo* pBeginInfo) {
4216 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4217 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004218
4219 // TODO: iterate over boundObjects and clear memory bindings
4220
4221 return ?
4222}
4223
4224@threadSafety("app")
4225cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004226 VkCommandBuffer commandBuffer) {
4227 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004228
4229 return ?
4230}
4231
4232@threadSafety("app")
4233cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004234 VkCommandBuffer commandBuffer,
4235 VkCommandBufferResetFlags flags) {
4236 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004237
4238 // TODO: iterate over boundObjects and clear memory bindings
4239
4240 return ?
4241}
4242
4243
4244// Command buffer building functions
4245
4246@threadSafety("app")
4247cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004248 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004249 VkPipelineBindPoint pipelineBindPoint,
4250 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004251 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004252 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004253 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004254
Jesse Halld8bade02015-11-24 10:24:18 -08004255 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004256 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4257 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4258 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004259 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004260}
4261
4262@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004263cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004264 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004265 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004266 u32 viewportCount,
4267 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004268 commandBufferObject := GetCommandBuffer(commandBuffer)
4269 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004270}
4271
4272@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004273cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004274 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004275 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004276 u32 scissorCount,
4277 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004278 commandBufferObject := GetCommandBuffer(commandBuffer)
4279 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004280}
4281
4282@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004283cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004284 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004285 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004286 commandBufferObject := GetCommandBuffer(commandBuffer)
4287 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004288}
4289
4290@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004291cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004292 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004293 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004294 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004295 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004296 commandBufferObject := GetCommandBuffer(commandBuffer)
4297 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004298}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004300@threadSafety("app")
4301cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004302 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004303 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4304 // an annotation as a quick hack to pass this to the template without
4305 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004306 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004307 commandBufferObject := GetCommandBuffer(commandBuffer)
4308 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004309}
4310
4311@threadSafety("app")
4312cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004313 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004314 f32 minDepthBounds,
4315 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004316 commandBufferObject := GetCommandBuffer(commandBuffer)
4317 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004318}
4319
4320@threadSafety("app")
4321cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004322 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004323 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004324 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004325 commandBufferObject := GetCommandBuffer(commandBuffer)
4326 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004327}
4328
4329@threadSafety("app")
4330cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004331 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004332 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004333 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004334 commandBufferObject := GetCommandBuffer(commandBuffer)
4335 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004336}
4337
4338@threadSafety("app")
4339cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004340 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004341 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004342 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004343 commandBufferObject := GetCommandBuffer(commandBuffer)
4344 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004345}
4346
4347@threadSafety("app")
4348cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004349 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004350 VkPipelineBindPoint pipelineBindPoint,
4351 VkPipelineLayout layout,
4352 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004353 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004354 const VkDescriptorSet* pDescriptorSets,
4355 u32 dynamicOffsetCount,
4356 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004357 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004358
Jesse Hall03b6fe12015-11-24 12:44:21 -08004359 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4360 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004361 descriptorSet := descriptorSets[i]
4362 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004363 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004364 }
4365
4366 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4367 for i in (0 .. dynamicOffsetCount) {
4368 dynamicOffset := dynamicOffsets[i]
4369 }
4370
Jesse Halld8bade02015-11-24 10:24:18 -08004371 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004372 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4373 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4374 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004375 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004376}
4377
4378@threadSafety("app")
4379cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004380 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004381 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004382 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004383 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004384 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004385 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004386 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004387
Jesse Hall3fbc8562015-11-29 22:10:52 -08004388 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004389
Jesse Hall3fbc8562015-11-29 22:10:52 -08004390 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004391}
4392
4393@threadSafety("app")
4394cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004395 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004396 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004397 u32 bindingCount,
4398 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004399 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004400 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004401
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004402 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004403 buffers := pBuffers[0:bindingCount]
4404 offsets := pOffsets[0:bindingCount]
4405 for i in (0 .. bindingCount) {
4406 buffer := buffers[i]
4407 offset := offsets[i]
4408 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004409 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004410
Jesse Hall3fbc8562015-11-29 22:10:52 -08004411 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004412 }
4413
Jesse Hall3fbc8562015-11-29 22:10:52 -08004414 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004415}
4416
4417@threadSafety("app")
4418cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004419 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004420 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004421 u32 instanceCount,
4422 u32 firstVertex,
4423 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004424 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004425
Jesse Hall3fbc8562015-11-29 22:10:52 -08004426 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004427}
4428
4429@threadSafety("app")
4430cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004431 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004432 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004433 u32 instanceCount,
4434 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004435 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004436 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004437 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004438
Jesse Hall3fbc8562015-11-29 22:10:52 -08004439 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004440}
4441
4442@threadSafety("app")
4443cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004444 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004445 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004446 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004447 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004448 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004449 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004450 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004451 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004452
Jesse Hall3fbc8562015-11-29 22:10:52 -08004453 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004454
Jesse Hall3fbc8562015-11-29 22:10:52 -08004455 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004456}
4457
4458@threadSafety("app")
4459cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004460 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004461 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004462 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004463 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004464 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004465 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004466 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004467 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004468
Jesse Hall3fbc8562015-11-29 22:10:52 -08004469 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004470
Jesse Hall3fbc8562015-11-29 22:10:52 -08004471 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004472}
4473
4474@threadSafety("app")
4475cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004476 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004477 u32 x,
4478 u32 y,
4479 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004480 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004481
Jesse Hall3fbc8562015-11-29 22:10:52 -08004482 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004483}
4484
4485@threadSafety("app")
4486cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004487 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004489 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004490 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004491 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004492 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004493
Jesse Hall3fbc8562015-11-29 22:10:52 -08004494 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004495
Jesse Hall3fbc8562015-11-29 22:10:52 -08004496 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004497}
4498
4499@threadSafety("app")
4500cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004501 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004502 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004503 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004504 u32 regionCount,
4505 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004506 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004507 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004508 dstBufferObject := GetBuffer(dstBuffer)
4509 assert(commandBufferObject.device == srcBufferObject.device)
4510 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004511
4512 regions := pRegions[0:regionCount]
4513 for i in (0 .. regionCount) {
4514 region := regions[i]
4515 }
4516
Jesse Hall3fbc8562015-11-29 22:10:52 -08004517 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4518 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004519
Jesse Hall65ab5522015-11-30 00:07:16 -08004520 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004521}
4522
4523@threadSafety("app")
4524cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004525 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004526 VkImage srcImage,
4527 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004528 VkImage dstImage,
4529 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004530 u32 regionCount,
4531 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004532 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004533 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004534 dstImageObject := GetImage(dstImage)
4535 assert(commandBufferObject.device == srcImageObject.device)
4536 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004537
4538 regions := pRegions[0:regionCount]
4539 for i in (0 .. regionCount) {
4540 region := regions[i]
4541 }
4542
Jesse Hall3fbc8562015-11-29 22:10:52 -08004543 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4544 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004545
Jesse Hall65ab5522015-11-30 00:07:16 -08004546 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004547}
4548
4549@threadSafety("app")
4550cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004551 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004552 VkImage srcImage,
4553 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004554 VkImage dstImage,
4555 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004556 u32 regionCount,
4557 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004558 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004559 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004560 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004561 dstImageObject := GetImage(dstImage)
4562 assert(commandBufferObject.device == srcImageObject.device)
4563 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004564
4565 regions := pRegions[0:regionCount]
4566 for i in (0 .. regionCount) {
4567 region := regions[i]
4568 }
4569
Jesse Hall3fbc8562015-11-29 22:10:52 -08004570 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4571 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004572
Jesse Hall3fbc8562015-11-29 22:10:52 -08004573 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004574}
4575
4576@threadSafety("app")
4577cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004578 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004579 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004580 VkImage dstImage,
4581 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004582 u32 regionCount,
4583 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004584 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004585 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004586 dstImageObject := GetImage(dstImage)
4587 assert(commandBufferObject.device == srcBufferObject.device)
4588 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004589
4590 regions := pRegions[0:regionCount]
4591 for i in (0 .. regionCount) {
4592 region := regions[i]
4593 }
4594
Jesse Hall3fbc8562015-11-29 22:10:52 -08004595 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4596 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004597
Jesse Hall65ab5522015-11-30 00:07:16 -08004598 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004599}
4600
4601@threadSafety("app")
4602cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004603 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004604 VkImage srcImage,
4605 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004606 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004607 u32 regionCount,
4608 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004609 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004610 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004611 dstBufferObject := GetBuffer(dstBuffer)
4612 assert(commandBufferObject.device == srcImageObject.device)
4613 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004614
4615 regions := pRegions[0:regionCount]
4616 for i in (0 .. regionCount) {
4617 region := regions[i]
4618 }
4619
Jesse Hall3fbc8562015-11-29 22:10:52 -08004620 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4621 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004622
Jesse Hall65ab5522015-11-30 00:07:16 -08004623 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004624}
4625
4626@threadSafety("app")
4627cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004628 VkCommandBuffer commandBuffer,
4629 VkBuffer dstBuffer,
4630 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004631 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07004632 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004633 commandBufferObject := GetCommandBuffer(commandBuffer)
4634 dstBufferObject := GetBuffer(dstBuffer)
4635 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004636
4637 data := pData[0:dataSize]
4638
Jesse Hall3fbc8562015-11-29 22:10:52 -08004639 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004640
Jesse Hall65ab5522015-11-30 00:07:16 -08004641 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004642}
4643
4644@threadSafety("app")
4645cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004646 VkCommandBuffer commandBuffer,
4647 VkBuffer dstBuffer,
4648 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004649 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004650 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004651 commandBufferObject := GetCommandBuffer(commandBuffer)
4652 dstBufferObject := GetBuffer(dstBuffer)
4653 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004654
Jesse Hall65ab5522015-11-30 00:07:16 -08004655 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004656}
4657
4658@threadSafety("app")
4659cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004660 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004661 VkImage image,
4662 VkImageLayout imageLayout,
4663 const VkClearColorValue* pColor,
4664 u32 rangeCount,
4665 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004666 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004667 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004668 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004669
4670 ranges := pRanges[0:rangeCount]
4671 for i in (0 .. rangeCount) {
4672 range := ranges[i]
4673 }
4674
Jesse Hall3fbc8562015-11-29 22:10:52 -08004675 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004676
Jesse Hall3fbc8562015-11-29 22:10:52 -08004677 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004678}
4679
4680@threadSafety("app")
4681cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004682 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004683 VkImage image,
4684 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004685 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004686 u32 rangeCount,
4687 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004688 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004689 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004690 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004691
4692 ranges := pRanges[0:rangeCount]
4693 for i in (0 .. rangeCount) {
4694 range := ranges[i]
4695 }
4696
Jesse Hall3fbc8562015-11-29 22:10:52 -08004697 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004698
Jesse Hall3fbc8562015-11-29 22:10:52 -08004699 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004700}
4701
4702@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08004703cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004704 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08004705 u32 attachmentCount,
4706 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004707 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08004708 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004709 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004710
4711 rects := pRects[0:rectCount]
4712 for i in (0 .. rectCount) {
4713 rect := rects[i]
4714 }
4715
Jesse Hall3fbc8562015-11-29 22:10:52 -08004716 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004717}
4718
4719@threadSafety("app")
4720cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004721 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004722 VkImage srcImage,
4723 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004724 VkImage dstImage,
4725 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004726 u32 regionCount,
4727 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004728 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004729 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004730 dstImageObject := GetImage(dstImage)
4731 assert(commandBufferObject.device == srcImageObject.device)
4732 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004733
4734 regions := pRegions[0:regionCount]
4735 for i in (0 .. regionCount) {
4736 region := regions[i]
4737 }
4738
Jesse Hall3fbc8562015-11-29 22:10:52 -08004739 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4740 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004741
Jesse Hall3fbc8562015-11-29 22:10:52 -08004742 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004743}
4744
4745@threadSafety("app")
4746cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004747 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004748 VkEvent event,
4749 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004750 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004751 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004752 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004753}
4754
4755@threadSafety("app")
4756cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004757 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004758 VkEvent event,
4759 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004760 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004761 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004762 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004763}
4764
4765@threadSafety("app")
4766cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004767 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004768 u32 eventCount,
4769 const VkEvent* pEvents,
4770 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004771 VkPipelineStageFlags dstStageMask,
4772 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004773 const VkMemoryBarrier* pMemoryBarriers,
4774 u32 bufferMemoryBarrierCount,
4775 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4776 u32 imageMemoryBarrierCount,
4777 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004778 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004779
4780 events := pEvents[0:eventCount]
4781 for i in (0 .. eventCount) {
4782 event := events[i]
4783 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004784 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004785 }
4786
Jesse Hall3dd678a2016-01-08 21:52:01 -08004787 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004788 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004789 memoryBarrier := memoryBarriers[i]
4790 }
4791 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4792 for i in (0 .. bufferMemoryBarrierCount) {
4793 bufferMemoryBarrier := bufferMemoryBarriers[i]
4794 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4795 assert(bufferObject.device == commandBufferObject.device)
4796 }
4797 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4798 for i in (0 .. imageMemoryBarrierCount) {
4799 imageMemoryBarrier := imageMemoryBarriers[i]
4800 imageObject := GetImage(imageMemoryBarrier.image)
4801 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004802 }
4803}
4804
4805@threadSafety("app")
4806cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004807 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004808 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004809 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08004810 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004811 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004812 const VkMemoryBarrier* pMemoryBarriers,
4813 u32 bufferMemoryBarrierCount,
4814 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4815 u32 imageMemoryBarrierCount,
4816 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004817 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004818
Jesse Hall3dd678a2016-01-08 21:52:01 -08004819 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004820 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004821 memoryBarrier := memoryBarriers[i]
4822 }
4823 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4824 for i in (0 .. bufferMemoryBarrierCount) {
4825 bufferMemoryBarrier := bufferMemoryBarriers[i]
4826 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4827 assert(bufferObject.device == commandBufferObject.device)
4828 }
4829 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4830 for i in (0 .. imageMemoryBarrierCount) {
4831 imageMemoryBarrier := imageMemoryBarriers[i]
4832 imageObject := GetImage(imageMemoryBarrier.image)
4833 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004834 }
4835}
4836
4837@threadSafety("app")
4838cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004839 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004840 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004841 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004842 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004843 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004844 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004845 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004846}
4847
4848@threadSafety("app")
4849cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004850 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004851 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004852 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004853 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004854 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004855 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004856}
4857
4858@threadSafety("app")
4859cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004860 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004861 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004862 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004863 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004864 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004865 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004866 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004867}
4868
4869@threadSafety("app")
4870cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004871 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08004872 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004873 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004874 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004875 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004876 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004877 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004878}
4879
4880@threadSafety("app")
4881cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004882 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004883 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004884 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004885 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004886 VkBuffer dstBuffer,
4887 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004888 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004889 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004890 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004891 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004892 dstBufferObject := GetBuffer(dstBuffer)
4893 assert(commandBufferObject.device == queryPoolObject.device)
4894 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004895}
4896
4897cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004898 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004899 VkPipelineLayout layout,
4900 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004901 u32 offset,
4902 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004903 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004904 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004905 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004906 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004907}
4908
4909@threadSafety("app")
4910cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004911 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004912 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08004913 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004914 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004915 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
4916 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004917 assert(commandBufferObject.device == renderPassObject.device)
4918 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004919
Jesse Hall3fbc8562015-11-29 22:10:52 -08004920 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004921}
4922
4923cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004924 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08004925 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004926 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004927}
4928
4929@threadSafety("app")
4930cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004931 VkCommandBuffer commandBuffer) {
4932 commandBufferObject := GetCommandBuffer(commandBuffer)
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
4937cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004938 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004939 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004940 const VkCommandBuffer* pCommandBuffers) {
4941 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004942
Jesse Hall3dd678a2016-01-08 21:52:01 -08004943 commandBuffers := pCommandBuffers[0:commandBufferCount]
4944 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004945 secondaryCommandBuffer := commandBuffers[i]
4946 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
4947 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004948 }
4949}
4950
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004951@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004952cmd void vkDestroySurfaceKHR(
4953 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08004954 VkSurfaceKHR surface,
4955 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004956 instanceObject := GetInstance(instance)
4957 surfaceObject := GetSurface(surface)
4958 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08004959
Jesse Hall1356b0d2015-11-23 17:24:58 -08004960 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08004961}
4962
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004963@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004964cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004965 VkPhysicalDevice physicalDevice,
4966 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004967 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08004968 VkBool32* pSupported) {
4969 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004970
4971 return ?
4972}
4973
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004974@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004975cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
4976 VkPhysicalDevice physicalDevice,
4977 VkSurfaceKHR surface,
4978 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
4979 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4980
4981 surfaceCapabilities := ?
4982 pSurfaceCapabilities[0] = surfaceCapabilities
4983
4984 return ?
4985}
4986
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004987@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004988cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
4989 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004990 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004991 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004992 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004993 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004994
4995 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004996 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004997 surfaceFormats := pSurfaceFormats[0:count]
4998
4999 for i in (0 .. count) {
5000 surfaceFormat := ?
5001 surfaceFormats[i] = surfaceFormat
5002 }
5003
5004 return ?
5005}
5006
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005007@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005008cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5009 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005010 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005011 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005012 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005013 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005014
5015 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005016 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005017 presentModes := pPresentModes[0:count]
5018
5019 for i in (0 .. count) {
5020 presentMode := ?
5021 presentModes[i] = presentMode
5022 }
5023
5024 return ?
5025}
5026
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005027@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005028cmd VkResult vkCreateSwapchainKHR(
5029 VkDevice device,
5030 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005031 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005032 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005033 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005034 deviceObject := GetDevice(device)
5035
5036 swapchain := ?
5037 pSwapchain[0] = swapchain
5038 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5039
5040 return ?
5041}
5042
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005043@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005044cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005045 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005046 VkSwapchainKHR swapchain,
5047 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005048 deviceObject := GetDevice(device)
5049 swapchainObject := GetSwapchain(swapchain)
5050 assert(swapchainObject.device == device)
5051
5052 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005053}
5054
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005055@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005056cmd VkResult vkGetSwapchainImagesKHR(
5057 VkDevice device,
5058 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005059 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005060 VkImage* pSwapchainImages) {
5061 deviceObject := GetDevice(device)
5062
5063 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005064 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005065 swapchainImages := pSwapchainImages[0:count]
5066
5067 for i in (0 .. count) {
5068 swapchainImage := ?
5069 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005070 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005071 }
5072
5073 return ?
5074}
5075
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005076@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005077cmd VkResult vkAcquireNextImageKHR(
5078 VkDevice device,
5079 VkSwapchainKHR swapchain,
5080 u64 timeout,
5081 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005082 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005083 u32* pImageIndex) {
5084 deviceObject := GetDevice(device)
5085 swapchainObject := GetSwapchain(swapchain)
5086
5087 imageIndex := ?
5088 pImageIndex[0] = imageIndex
5089
5090 return ?
5091}
5092
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005093@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005094cmd VkResult vkQueuePresentKHR(
5095 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005096 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005097 queueObject := GetQueue(queue)
5098
5099 presentInfo := ?
5100 pPresentInfo[0] = presentInfo
5101
5102 return ?
5103}
5104
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005105@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005106cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5107 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005108 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005109 VkDisplayPropertiesKHR* pProperties) {
5110 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5111 return ?
5112}
5113
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005114@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005115cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5116 VkPhysicalDevice physicalDevice,
5117 u32* pPropertyCount,
5118 VkDisplayPlanePropertiesKHR* pProperties) {
5119 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5120 return ?
5121}
5122
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005123@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005124cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5125 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005126 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005127 u32* pDisplayCount,
5128 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005129 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5130 return ?
5131}
5132
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005133@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005134cmd VkResult vkGetDisplayModePropertiesKHR(
5135 VkPhysicalDevice physicalDevice,
5136 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005137 u32* pPropertyCount,
5138 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005139 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5140 return ?
5141}
5142
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005143@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005144cmd VkResult vkCreateDisplayModeKHR(
5145 VkPhysicalDevice physicalDevice,
5146 VkDisplayKHR display,
5147 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005148 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005149 VkDisplayModeKHR* pMode) {
5150 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5151 return ?
5152}
5153
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005154@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005155cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005156 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005157 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005158 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005159 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005160 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5161 return ?
5162}
5163
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005164@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005165cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5166 VkInstance instance,
5167 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005168 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005169 VkSurfaceKHR* pSurface) {
5170 return ?
5171}
5172
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005173@extension("VK_KHR_display_swapchain")
5174cmd VkResult vkCreateSharedSwapchainsKHR(
5175 VkDevice device,
5176 u32 swapchainCount,
5177 const VkSwapchainCreateInfoKHR* pCreateInfos,
5178 const VkAllocationCallbacks* pAllocator,
5179 VkSwapchainKHR* pSwapchains) {
5180 return ?
5181}
5182
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005183@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005184cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005185 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005186 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005187 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005188 VkSurfaceKHR* pSurface) {
5189 instanceObject := GetInstance(instance)
5190 return ?
5191}
5192
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005193@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005194cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5195 VkPhysicalDevice physicalDevice,
5196 u32 queueFamilyIndex,
5197 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005198 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005199 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5200 return ?
5201}
5202
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005203@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005204cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005205 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005206 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005207 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005208 VkSurfaceKHR* pSurface) {
5209 instanceObject := GetInstance(instance)
5210 return ?
5211}
5212
Jesse Hall523db342015-11-30 21:12:55 -08005213@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005214cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5215 VkPhysicalDevice physicalDevice,
5216 u32 queueFamilyIndex,
5217 platform.xcb_connection_t* connection,
5218 platform.xcb_visualid_t visual_id) {
5219 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5220 return ?
5221}
5222
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005223@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005224cmd VkResult vkCreateWaylandSurfaceKHR(
5225 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005226 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005227 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005228 VkSurfaceKHR* pSurface) {
5229 instanceObject := GetInstance(instance)
5230 return ?
5231}
5232
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005233@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005234cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5235 VkPhysicalDevice physicalDevice,
5236 u32 queueFamilyIndex,
5237 platform.wl_display* display) {
5238 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5239 return ?
5240}
5241
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005242@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005243cmd VkResult vkCreateMirSurfaceKHR(
5244 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005245 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005246 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005247 VkSurfaceKHR* pSurface) {
5248 instanceObject := GetInstance(instance)
5249 return ?
5250}
5251
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005252@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005253cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5254 VkPhysicalDevice physicalDevice,
5255 u32 queueFamilyIndex,
5256 platform.MirConnection* connection) {
5257 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5258 return ?
5259}
5260
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005261@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005262cmd VkResult vkCreateAndroidSurfaceKHR(
5263 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005264 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005265 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005266 VkSurfaceKHR* pSurface) {
5267 instanceObject := GetInstance(instance)
5268 return ?
5269}
5270
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005271@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005272cmd VkResult vkCreateWin32SurfaceKHR(
5273 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005274 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005275 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005276 VkSurfaceKHR* pSurface) {
5277 instanceObject := GetInstance(instance)
5278 return ?
5279}
5280
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005281@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005282cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5283 VkPhysicalDevice physicalDevice,
5284 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005285 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005286 return ?
5287}
5288
Chia-I Wub262ddc2016-03-22 07:38:20 +08005289@extension("VK_ANDROID_native_buffer")
5290cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5291 VkDevice device,
5292 VkFormat format,
5293 VkImageUsageFlags imageUsage,
5294 int* grallocUsage) {
5295 return ?
5296}
5297
5298@extension("VK_ANDROID_native_buffer")
Chris Forbes8e4438b2016-12-07 16:26:49 +13005299cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5300 VkDevice device,
5301 VkFormat format,
5302 VkImageUsageFlags imageUsage,
5303 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
5304 int* grallocUsage) {
5305 return ?
5306}
5307
5308@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005309cmd VkResult vkAcquireImageANDROID(
5310 VkDevice device,
5311 VkImage image,
5312 int nativeFenceFd,
5313 VkSemaphore semaphore,
5314 VkFence fence) {
5315 return ?
5316}
5317
5318@extension("VK_ANDROID_native_buffer")
5319cmd VkResult vkQueueSignalReleaseImageANDROID(
5320 VkQueue queue,
5321 u32 waitSemaphoreCount,
5322 const VkSemaphore* pWaitSemaphores,
5323 VkImage image,
5324 int* pNativeFenceFd) {
5325 return ?
5326}
5327
Jesse Hall715b86a2016-01-16 16:34:29 -08005328@extension("VK_EXT_debug_report")
5329@external type void* PFN_vkDebugReportCallbackEXT
5330@extension("VK_EXT_debug_report")
5331@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5332 VkDebugReportFlagsEXT flags,
5333 VkDebugReportObjectTypeEXT objectType,
5334 u64 object,
5335 platform.size_t location,
5336 s32 messageCode,
5337 const char* pLayerPrefix,
5338 const char* pMessage,
5339 void* pUserData) {
5340 return ?
5341}
5342
5343@extension("VK_EXT_debug_report")
5344cmd VkResult vkCreateDebugReportCallbackEXT(
5345 VkInstance instance,
5346 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5347 const VkAllocationCallbacks* pAllocator,
5348 VkDebugReportCallbackEXT* pCallback) {
5349 return ?
5350}
5351
5352@extension("VK_EXT_debug_report")
5353cmd void vkDestroyDebugReportCallbackEXT(
5354 VkInstance instance,
5355 VkDebugReportCallbackEXT callback,
5356 const VkAllocationCallbacks* pAllocator) {
5357}
5358
5359@extension("VK_EXT_debug_report")
5360cmd void vkDebugReportMessageEXT(
5361 VkInstance instance,
5362 VkDebugReportFlagsEXT flags,
5363 VkDebugReportObjectTypeEXT objectType,
5364 u64 object,
5365 platform.size_t location,
5366 s32 messageCode,
5367 const char* pLayerPrefix,
5368 const char* pMessage) {
5369}
5370
Jesse Hall26763382016-05-20 07:13:52 -07005371@extension("VK_EXT_debug_marker")
5372cmd VkResult vkDebugMarkerSetObjectTagEXT(
5373 VkDevice device,
5374 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5375 return ?
5376}
5377
5378@extension("VK_EXT_debug_marker")
5379cmd VkResult vkDebugMarkerSetObjectNameEXT(
5380 VkDevice device,
5381 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5382 return ?
5383}
5384
5385@extension("VK_EXT_debug_marker")
5386cmd void vkCmdDebugMarkerBeginEXT(
5387 VkCommandBuffer commandBuffer,
5388 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5389}
5390
5391@extension("VK_EXT_debug_marker")
5392cmd void vkCmdDebugMarkerEndEXT(
5393 VkCommandBuffer commandBuffer) {
5394}
5395
5396@extension("VK_EXT_debug_marker")
5397cmd void vkCmdDebugMarkerInsertEXT(
5398 VkCommandBuffer commandBuffer,
5399 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5400}
5401
Jesse Halld27f6aa2015-08-15 17:58:48 -07005402
5403////////////////
5404// Validation //
5405////////////////
5406
5407extern void validate(string layerName, bool condition, string message)
5408
5409
5410/////////////////////////////
5411// Internal State Tracking //
5412/////////////////////////////
5413
5414StateObject State
5415
5416@internal class StateObject {
5417 // Dispatchable objects.
5418 map!(VkInstance, ref!InstanceObject) Instances
5419 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5420 map!(VkDevice, ref!DeviceObject) Devices
5421 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005422 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005423
5424 // Non-dispatchable objects.
5425 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5426 map!(VkBuffer, ref!BufferObject) Buffers
5427 map!(VkBufferView, ref!BufferViewObject) BufferViews
5428 map!(VkImage, ref!ImageObject) Images
5429 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005430 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005431 map!(VkPipeline, ref!PipelineObject) Pipelines
5432 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5433 map!(VkSampler, ref!SamplerObject) Samplers
5434 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5435 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5436 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005437 map!(VkFence, ref!FenceObject) Fences
5438 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5439 map!(VkEvent, ref!EventObject) Events
5440 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5441 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5442 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5443 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005444 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005445 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005446 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005447}
5448
5449@internal class InstanceObject {
5450}
5451
5452@internal class PhysicalDeviceObject {
5453 VkInstance instance
5454}
5455
5456@internal class DeviceObject {
5457 VkPhysicalDevice physicalDevice
5458}
5459
5460@internal class QueueObject {
5461 VkDevice device
5462 VkQueueFlags flags
5463}
5464
Jesse Hall3fbc8562015-11-29 22:10:52 -08005465@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005466 VkDevice device
5467 map!(u64, VkDeviceMemory) boundObjects
5468 VkQueueFlags queueFlags
5469}
5470
5471@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005472 VkDevice device
5473 VkDeviceSize allocationSize
5474 map!(u64, VkDeviceSize) boundObjects
5475 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005476}
5477
5478@internal class BufferObject {
5479 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005480 VkDeviceMemory memory
5481 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005482}
5483
5484@internal class BufferViewObject {
5485 VkDevice device
5486 VkBuffer buffer
5487}
5488
5489@internal class ImageObject {
5490 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005491 VkDeviceMemory memory
5492 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005493}
5494
5495@internal class ImageViewObject {
5496 VkDevice device
5497 VkImage image
5498}
5499
Jesse Halld27f6aa2015-08-15 17:58:48 -07005500@internal class ShaderObject {
5501 VkDevice device
5502}
5503
5504@internal class ShaderModuleObject {
5505 VkDevice device
5506}
5507
5508@internal class PipelineObject {
5509 VkDevice device
5510}
5511
5512@internal class PipelineLayoutObject {
5513 VkDevice device
5514}
5515
5516@internal class SamplerObject {
5517 VkDevice device
5518}
5519
5520@internal class DescriptorSetObject {
5521 VkDevice device
5522}
5523
5524@internal class DescriptorSetLayoutObject {
5525 VkDevice device
5526}
5527
5528@internal class DescriptorPoolObject {
5529 VkDevice device
5530}
5531
Jesse Halld27f6aa2015-08-15 17:58:48 -07005532@internal class FenceObject {
5533 VkDevice device
5534 bool signaled
5535}
5536
5537@internal class SemaphoreObject {
5538 VkDevice device
5539}
5540
5541@internal class EventObject {
5542 VkDevice device
5543}
5544
5545@internal class QueryPoolObject {
5546 VkDevice device
5547}
5548
5549@internal class FramebufferObject {
5550 VkDevice device
5551}
5552
5553@internal class RenderPassObject {
5554 VkDevice device
5555}
5556
5557@internal class PipelineCacheObject {
5558 VkDevice device
5559}
5560
Jesse Hall3fbc8562015-11-29 22:10:52 -08005561@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005562 VkDevice device
5563}
5564
Jesse Hall1356b0d2015-11-23 17:24:58 -08005565@internal class SurfaceObject {
5566 VkInstance instance
5567}
5568
Michael Lentine88594d72015-11-12 12:49:45 -08005569@internal class SwapchainObject {
5570 VkDevice device
5571}
5572
Jesse Halld27f6aa2015-08-15 17:58:48 -07005573macro ref!InstanceObject GetInstance(VkInstance instance) {
5574 assert(instance in State.Instances)
5575 return State.Instances[instance]
5576}
5577
5578macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
5579 assert(physicalDevice in State.PhysicalDevices)
5580 return State.PhysicalDevices[physicalDevice]
5581}
5582
5583macro ref!DeviceObject GetDevice(VkDevice device) {
5584 assert(device in State.Devices)
5585 return State.Devices[device]
5586}
5587
5588macro ref!QueueObject GetQueue(VkQueue queue) {
5589 assert(queue in State.Queues)
5590 return State.Queues[queue]
5591}
5592
Jesse Hall3fbc8562015-11-29 22:10:52 -08005593macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
5594 assert(commandBuffer in State.CommandBuffers)
5595 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005596}
5597
Jesse Hall3fbc8562015-11-29 22:10:52 -08005598macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
5599 assert(memory in State.DeviceMemories)
5600 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005601}
5602
5603macro ref!BufferObject GetBuffer(VkBuffer buffer) {
5604 assert(buffer in State.Buffers)
5605 return State.Buffers[buffer]
5606}
5607
5608macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
5609 assert(bufferView in State.BufferViews)
5610 return State.BufferViews[bufferView]
5611}
5612
5613macro ref!ImageObject GetImage(VkImage image) {
5614 assert(image in State.Images)
5615 return State.Images[image]
5616}
5617
5618macro ref!ImageViewObject GetImageView(VkImageView imageView) {
5619 assert(imageView in State.ImageViews)
5620 return State.ImageViews[imageView]
5621}
5622
Jesse Halld27f6aa2015-08-15 17:58:48 -07005623macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
5624 assert(shaderModule in State.ShaderModules)
5625 return State.ShaderModules[shaderModule]
5626}
5627
5628macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
5629 assert(pipeline in State.Pipelines)
5630 return State.Pipelines[pipeline]
5631}
5632
5633macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
5634 assert(pipelineLayout in State.PipelineLayouts)
5635 return State.PipelineLayouts[pipelineLayout]
5636}
5637
5638macro ref!SamplerObject GetSampler(VkSampler sampler) {
5639 assert(sampler in State.Samplers)
5640 return State.Samplers[sampler]
5641}
5642
5643macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
5644 assert(descriptorSet in State.DescriptorSets)
5645 return State.DescriptorSets[descriptorSet]
5646}
5647
5648macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
5649 assert(descriptorSetLayout in State.DescriptorSetLayouts)
5650 return State.DescriptorSetLayouts[descriptorSetLayout]
5651}
5652
5653macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
5654 assert(descriptorPool in State.DescriptorPools)
5655 return State.DescriptorPools[descriptorPool]
5656}
5657
Jesse Halld27f6aa2015-08-15 17:58:48 -07005658macro ref!FenceObject GetFence(VkFence fence) {
5659 assert(fence in State.Fences)
5660 return State.Fences[fence]
5661}
5662
5663macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
5664 assert(semaphore in State.Semaphores)
5665 return State.Semaphores[semaphore]
5666}
5667
5668macro ref!EventObject GetEvent(VkEvent event) {
5669 assert(event in State.Events)
5670 return State.Events[event]
5671}
5672
5673macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
5674 assert(queryPool in State.QueryPools)
5675 return State.QueryPools[queryPool]
5676}
5677
5678macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
5679 assert(framebuffer in State.Framebuffers)
5680 return State.Framebuffers[framebuffer]
5681}
5682
5683macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
5684 assert(renderPass in State.RenderPasses)
5685 return State.RenderPasses[renderPass]
5686}
5687
5688macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
5689 assert(pipelineCache in State.PipelineCaches)
5690 return State.PipelineCaches[pipelineCache]
5691}
5692
Jesse Hall3fbc8562015-11-29 22:10:52 -08005693macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
5694 assert(commandPool in State.CommandPools)
5695 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07005696}
Michael Lentine88594d72015-11-12 12:49:45 -08005697
Jesse Hall1356b0d2015-11-23 17:24:58 -08005698macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
5699 assert(surface in State.Surfaces)
5700 return State.Surfaces[surface]
5701}
5702
Michael Lentine88594d72015-11-12 12:49:45 -08005703macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
5704 assert(swapchain in State.Swapchains)
5705 return State.Swapchains[swapchain]
5706}
Jesse Halld8bade02015-11-24 10:24:18 -08005707
5708macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
5709 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
5710}