blob: 37cc44886a1f45909057cd9f16181a505b08e55f [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
Chia-I Wub262ddc2016-03-22 07:38:20 +080078@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 5
79@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,
684
Jesse Hall543a7ff2016-01-08 16:38:30 -0800685 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700686 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
687
688 //@extension("VK_AMD_rasterization_order")
689 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
690
691 //@extension("VK_EXT_debug_marker")
692 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
693
694 //@extension("VK_EXT_debug_marker")
695 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
696
697 //@extension("VK_EXT_debug_marker")
698 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700699
700 //@extension("VK_NV_dedicated_allocation")
701 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
702
703 //@extension("VK_NV_dedicated_allocation")
704 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
705
706 //@extension("VK_NV_dedicated_allocation")
707 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700708}
709
Jesse Hall65ab5522015-11-30 00:07:16 -0800710enum VkSubpassContents {
711 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
712 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700713}
714
Jesse Hall543a7ff2016-01-08 16:38:30 -0800715enum VkPipelineCacheHeaderVersion {
716 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
717}
718
Jesse Hallbd888842015-11-30 21:44:14 -0800719@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700720/// Error and return codes
721enum VkResult {
722 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800723 VK_SUCCESS = 0,
724 VK_NOT_READY = 1,
725 VK_TIMEOUT = 2,
726 VK_EVENT_SET = 3,
727 VK_EVENT_RESET = 4,
728 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700729
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800730 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800731 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800732
Jesse Halld27f6aa2015-08-15 17:58:48 -0700733 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800734 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
735 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
736 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
737 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
738 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
739 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
740 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
741 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
742 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
743 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
744 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700745 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800746
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800747 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800748 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800749
Jesse Hall563380d2016-01-15 23:14:05 -0800750 //@extension("VK_KHR_surface")
751 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
752
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800753 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800754 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800755
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800756 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800757 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800758
Jesse Hall543a7ff2016-01-08 16:38:30 -0800759 //@extension("VK_EXT_debug_report")
760 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700761
762 //@extension("VK_NV_glsl_shader")
763 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700764}
765
766enum VkDynamicState {
767 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
768 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
769 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
770 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
771 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
772 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
773 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
774 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
775 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700776}
777
Jesse Hall523db342015-11-30 21:12:55 -0800778@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800779enum VkPresentModeKHR {
780 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
781 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
782 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800783 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800784}
785
Jesse Hall523db342015-11-30 21:12:55 -0800786@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800787enum VkColorSpaceKHR {
788 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
789}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700790
Jesse Hall715b86a2016-01-16 16:34:29 -0800791@extension("VK_EXT_debug_report")
792enum VkDebugReportObjectTypeEXT {
793 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
794 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
795 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
796 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
797 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
798 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
799 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
800 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
801 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
802 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
803 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
804 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
805 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
806 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
807 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
808 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
809 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
810 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
811 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
812 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
813 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
814 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
815 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
816 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
817 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
818 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
819 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
820 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
821 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
822}
823
824@extension("VK_EXT_debug_report")
825enum VkDebugReportErrorEXT {
826 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
827 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
828}
829
Jesse Hall26763382016-05-20 07:13:52 -0700830@extension("VK_AMD_rasterization_order")
831enum VkRasterizationOrderAMD {
832 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
833 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
834}
835
Jesse Hall715b86a2016-01-16 16:34:29 -0800836
Jesse Halld27f6aa2015-08-15 17:58:48 -0700837/////////////////
838// Bitfields //
839/////////////////
840
Jesse Halld27f6aa2015-08-15 17:58:48 -0700841/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -0800842type VkFlags VkQueueFlags
843bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700844 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
845 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -0800846 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -0800847 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700848}
849
850/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -0800851type VkFlags VkMemoryPropertyFlags
852bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800853 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
854 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
855 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
856 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
857 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700858}
859
860/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -0800861type VkFlags VkMemoryHeapFlags
862bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800863 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700864}
865
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800866/// Access flags
867type VkFlags VkAccessFlags
868bitfield VkAccessFlagBits {
869 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
870 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
871 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
872 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
873 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
874 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
875 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
876 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
877 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
878 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
879 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
880 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
881 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
882 VK_ACCESS_HOST_READ_BIT = 0x00002000,
883 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
884 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
885 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700886}
887
888/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800889type VkFlags VkBufferUsageFlags
890bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800891 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
892 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700893 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
894 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
895 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
896 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
897 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
898 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
899 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
900}
901
902/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800903type VkFlags VkBufferCreateFlags
904bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700905 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700906 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
907 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
908}
909
910/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800911type VkFlags VkShaderStageFlags
912bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700913 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -0800914 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
915 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700916 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
917 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
918 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -0800919 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700920
921 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
922}
923
Jesse Hallfbf97b02015-11-20 14:17:03 -0800924/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -0800925type VkFlags VkDescriptorPoolCreateFlags
926bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800927 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
928}
929
930/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -0800931type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -0800932//bitfield VkDescriptorPoolResetFlagBits {
933//}
Jesse Hallfbf97b02015-11-20 14:17:03 -0800934
Jesse Halld27f6aa2015-08-15 17:58:48 -0700935/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800936type VkFlags VkImageUsageFlags
937bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800938 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
939 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700940 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
941 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
942 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700943 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -0700944 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
945 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
946}
947
948/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800949type VkFlags VkImageCreateFlags
950bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700951 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700952 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
953 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 -0700954 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
955 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 -0700956}
957
Jesse Hallb00daad2015-11-29 19:46:20 -0800958/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800959type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -0800960//bitfield VkImageViewCreateFlagBits {
961//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700962
963/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800964type VkFlags VkPipelineCreateFlags
965bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700966 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
967 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
968 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
969}
970
Jesse Hall65ab5522015-11-30 00:07:16 -0800971/// Color component flags
972type VkFlags VkColorComponentFlags
973bitfield VkColorComponentFlagBits {
974 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
975 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
976 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
977 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700978}
979
980/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800981type VkFlags VkFenceCreateFlags
982bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700983 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
984}
985
986/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800987type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800988//bitfield VkSemaphoreCreateFlagBits {
989//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700990
991/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -0800992type VkFlags VkFormatFeatureFlags
993bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700994 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
995 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
996 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
997 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
998 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
999 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1000 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1001 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1002 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1003 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001004 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1005 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 -08001006 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001007
1008 //@extension("VK_IMG_filter_cubic")
1009 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001010}
1011
1012/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001013type VkFlags VkQueryControlFlags
1014bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001015 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001016}
1017
1018/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001019type VkFlags VkQueryResultFlags
1020bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001021 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1022 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1023 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1024 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1025}
1026
1027/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001028type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001029//bitfield VkShaderModuleCreateFlagBits {
1030//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001031
Jesse Halld27f6aa2015-08-15 17:58:48 -07001032/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001033type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001034//bitfield VkEventCreateFlagBits {
1035//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001036
Jesse Halla15a4bf2015-11-19 22:48:02 -08001037/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001038type VkFlags VkCommandBufferUsageFlags
1039bitfield VkCommandBufferUsageFlagBits {
1040 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1041 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1042 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001043}
1044
1045/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001046type VkFlags VkQueryPipelineStatisticFlags
1047bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001048 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1049 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1050 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1051 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1052 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1053 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1054 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1055 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1056 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1057 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1058 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001059}
1060
1061/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001062type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001063//bitfield VkMemoryMapFlagBits {
1064//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001065
1066/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001067type VkFlags VkImageAspectFlags
1068bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001069 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1070 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1071 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1072 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1073}
1074
1075/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001076type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001077bitfield VkSparseMemoryBindFlagBits {
1078 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1079}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001080
1081/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001082type VkFlags VkSparseImageFormatFlags
1083bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001084 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1085 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.
1086 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001087}
1088
1089/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001090type VkFlags VkPipelineStageFlags
1091bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001092 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1093 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1094 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1095 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001096 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1097 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001098 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1099 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1100 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1101 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1102 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1103 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1104 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001105 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1106 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001107
Jesse Hall543a7ff2016-01-08 16:38:30 -08001108 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1109 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001110}
1111
1112/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001113type VkFlags VkAttachmentDescriptionFlags
1114bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001115 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 -07001116}
1117
1118/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001119type VkFlags VkSubpassDescriptionFlags
1120bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001121}
1122
1123/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001124type VkFlags VkCommandPoolCreateFlags
1125bitfield VkCommandPoolCreateFlagBits {
1126 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1127 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001128}
1129
1130/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001131type VkFlags VkCommandPoolResetFlags
1132bitfield VkCommandPoolResetFlagBits {
1133 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001134}
1135
Jesse Hall3fbc8562015-11-29 22:10:52 -08001136type VkFlags VkCommandBufferResetFlags
1137bitfield VkCommandBufferResetFlagBits {
1138 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001139}
1140
Jesse Halld8bade02015-11-24 10:24:18 -08001141type VkFlags VkSampleCountFlags
1142bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001143 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1144 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1145 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1146 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1147 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1148 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1149 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1150}
1151
Jesse Halld8bade02015-11-24 10:24:18 -08001152type VkFlags VkStencilFaceFlags
1153bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001154 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1155 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001156 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001157}
1158
Jesse Halla6429252015-11-29 18:59:42 -08001159/// Instance creation flags
1160type VkFlags VkInstanceCreateFlags
1161//bitfield VkInstanceCreateFlagBits {
1162//}
1163
1164/// Device creation flags
1165type VkFlags VkDeviceCreateFlags
1166//bitfield VkDeviceCreateFlagBits {
1167//}
1168
1169/// Device queue creation flags
1170type VkFlags VkDeviceQueueCreateFlags
1171//bitfield VkDeviceQueueCreateFlagBits {
1172//}
1173
1174/// Query pool creation flags
1175type VkFlags VkQueryPoolCreateFlags
1176//bitfield VkQueryPoolCreateFlagBits {
1177//}
1178
1179/// Buffer view creation flags
1180type VkFlags VkBufferViewCreateFlags
1181//bitfield VkBufferViewCreateFlagBits {
1182//}
1183
1184/// Pipeline cache creation flags
1185type VkFlags VkPipelineCacheCreateFlags
1186//bitfield VkPipelineCacheCreateFlagBits {
1187//}
1188
1189/// Pipeline shader stage creation flags
1190type VkFlags VkPipelineShaderStageCreateFlags
1191//bitfield VkPipelineShaderStageCreateFlagBits {
1192//}
1193
1194/// Descriptor set layout creation flags
1195type VkFlags VkDescriptorSetLayoutCreateFlags
1196//bitfield VkDescriptorSetLayoutCreateFlagBits {
1197//}
1198
1199/// Pipeline vertex input state creation flags
1200type VkFlags VkPipelineVertexInputStateCreateFlags
1201//bitfield VkPipelineVertexInputStateCreateFlagBits {
1202//}
1203
1204/// Pipeline input assembly state creation flags
1205type VkFlags VkPipelineInputAssemblyStateCreateFlags
1206//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1207//}
1208
1209/// Tessellation state creation flags
1210type VkFlags VkPipelineTessellationStateCreateFlags
1211//bitfield VkPipelineTessellationStateCreateFlagBits {
1212//}
1213
1214/// Viewport state creation flags
1215type VkFlags VkPipelineViewportStateCreateFlags
1216//bitfield VkPipelineViewportStateCreateFlagBits {
1217//}
1218
Jesse Hall3fbc8562015-11-29 22:10:52 -08001219/// Rasterization state creation flags
1220type VkFlags VkPipelineRasterizationStateCreateFlags
1221//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001222//}
1223
1224/// Multisample state creation flags
1225type VkFlags VkPipelineMultisampleStateCreateFlags
1226//bitfield VkPipelineMultisampleStateCreateFlagBits {
1227//}
1228
1229/// Color blend state creation flags
1230type VkFlags VkPipelineColorBlendStateCreateFlags
1231//bitfield VkPipelineColorBlendStateCreateFlagBits {
1232//}
1233
1234/// Depth/stencil state creation flags
1235type VkFlags VkPipelineDepthStencilStateCreateFlags
1236//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1237//}
1238
1239/// Dynamic state creation flags
1240type VkFlags VkPipelineDynamicStateCreateFlags
1241//bitfield VkPipelineDynamicStateCreateFlagBits {
1242//}
1243
1244/// Pipeline layout creation flags
1245type VkFlags VkPipelineLayoutCreateFlags
1246//bitfield VkPipelineLayoutCreateFlagBits {
1247//}
1248
1249/// Sampler creation flags
1250type VkFlags VkSamplerCreateFlags
1251//bitfield VkSamplerCreateFlagBits {
1252//}
1253
1254/// Render pass creation flags
1255type VkFlags VkRenderPassCreateFlags
1256//bitfield VkRenderPassCreateFlagBits {
1257//}
1258
1259/// Framebuffer creation flags
1260type VkFlags VkFramebufferCreateFlags
1261//bitfield VkFramebufferCreateFlagBits {
1262//}
1263
Jesse Halldc6d36c2015-11-29 19:12:15 -08001264/// Dependency flags
1265type VkFlags VkDependencyFlags
1266bitfield VkDependencyFlagBits {
1267 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1268}
1269
Jesse Hallc7467b72015-11-29 21:05:26 -08001270/// Cull mode flags
1271type VkFlags VkCullModeFlags
1272bitfield VkCullModeFlagBits {
1273 VK_CULL_MODE_NONE = 0x00000000,
1274 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1275 VK_CULL_MODE_BACK_BIT = 0x00000002,
1276 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1277}
1278
Jesse Hall523db342015-11-30 21:12:55 -08001279@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001280type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001281@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001282bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001283 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001284 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1285 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1286 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1287 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1288 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1289 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1290 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1291 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001292}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001293
Jesse Hall523db342015-11-30 21:12:55 -08001294@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001295type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001296@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001297bitfield VkCompositeAlphaFlagBitsKHR {
1298 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1299 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1300 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1301 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1302}
1303
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001304@extension("VK_KHR_swapchain")
1305type VkFlags VkSwapchainCreateFlagsKHR
1306//@extension("VK_KHR_swapchain")
1307//bitfield VkSwapchainCreateFlagBitsKHR {
1308//}
1309
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001310@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001311type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001312@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001313bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001314 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1315 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1316 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1317 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001318}
1319
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001320@extension("VK_KHR_display")
1321type VkFlags VkDisplaySurfaceCreateFlagsKHR
1322//@extension("VK_KHR_display")
1323//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1324//}
1325
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001326@extension("VK_KHR_display")
1327type VkFlags VkDisplayModeCreateFlagsKHR
1328//@extension("VK_KHR_display")
1329//bitfield VkDisplayModeCreateFlagBitsKHR {
1330//}
1331
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001332@extension("VK_KHR_xlib_surface")
1333type VkFlags VkXlibSurfaceCreateFlagsKHR
1334//@extension("VK_KHR_xlib_surface")
1335//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1336//}
1337
1338@extension("VK_KHR_xcb_surface")
1339type VkFlags VkXcbSurfaceCreateFlagsKHR
1340//@extension("VK_KHR_xcb_surface")
1341//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1342//}
1343
1344@extension("VK_KHR_wayland_surface")
1345type VkFlags VkWaylandSurfaceCreateFlagsKHR
1346//@extension("VK_KHR_wayland_surface")
1347//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1348//}
1349
1350@extension("VK_KHR_mir_surface")
1351type VkFlags VkMirSurfaceCreateFlagsKHR
1352//@extension("VK_KHR_mir_surface")
1353//bitfield VkMirSurfaceCreateFlagBitsKHR {
1354//}
1355
1356@extension("VK_KHR_android_surface")
1357type VkFlags VkAndroidSurfaceCreateFlagsKHR
1358//@extension("VK_KHR_android_surface")
1359//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1360//}
1361
1362@extension("VK_KHR_win32_surface")
1363type VkFlags VkWin32SurfaceCreateFlagsKHR
1364//@extension("VK_KHR_win32_surface")
1365//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1366//}
1367
Jesse Hall715b86a2016-01-16 16:34:29 -08001368@extension("VK_EXT_debug_report")
1369type VkFlags VkDebugReportFlagsEXT
1370@extension("VK_EXT_debug_report")
1371bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001372 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1373 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1374 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001375 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1376 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1377}
1378
Jesse Hall1356b0d2015-11-23 17:24:58 -08001379
Jesse Halld27f6aa2015-08-15 17:58:48 -07001380//////////////////
1381// Structures //
1382//////////////////
1383
1384class VkOffset2D {
1385 s32 x
1386 s32 y
1387}
1388
1389class VkOffset3D {
1390 s32 x
1391 s32 y
1392 s32 z
1393}
1394
1395class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001396 u32 width
1397 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001398}
1399
1400class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001401 u32 width
1402 u32 height
1403 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001404}
1405
1406class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001407 f32 x
1408 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001409 f32 width
1410 f32 height
1411 f32 minDepth
1412 f32 maxDepth
1413}
1414
1415class VkRect2D {
1416 VkOffset2D offset
1417 VkExtent2D extent
1418}
1419
Jesse Halla15a4bf2015-11-19 22:48:02 -08001420class VkClearRect {
1421 VkRect2D rect
1422 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001423 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001424}
1425
Jesse Hall65ab5522015-11-30 00:07:16 -08001426class VkComponentMapping {
1427 VkComponentSwizzle r
1428 VkComponentSwizzle g
1429 VkComponentSwizzle b
1430 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001431}
1432
1433class VkPhysicalDeviceProperties {
1434 u32 apiVersion
1435 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001436 u32 vendorID
1437 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001438 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001439 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1440 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001441 VkPhysicalDeviceLimits limits
1442 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001443}
1444
1445class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001446 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001447 u32 specVersion /// version of the extension specification implemented
1448}
1449
1450class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001451 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001452 u32 specVersion /// version of the layer specification implemented
1453 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001454 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001455}
1456
Jesse Halla366a512015-11-19 22:30:07 -08001457class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001458 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1459 const void* pNext /// Next structure in chain
1460 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001461 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001462 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001463 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001464 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001465 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001466 const VkSemaphore* pSignalSemaphores
1467}
1468
Jesse Halld27f6aa2015-08-15 17:58:48 -07001469class VkApplicationInfo {
1470 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1471 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001472 const char* pApplicationName
1473 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001474 const char* pEngineName
1475 u32 engineVersion
1476 u32 apiVersion
1477}
1478
Jesse Hall3fbc8562015-11-29 22:10:52 -08001479class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001480 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001481 PFN_vkAllocationFunction pfnAllocation
1482 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001483 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001484 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001485 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001486}
1487
1488class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001489 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1490 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001491 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001492 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001493 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001494 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001495}
1496
1497class VkDeviceCreateInfo {
1498 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1499 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001500 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001501 u32 queueCreateInfoCount
1502 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001503 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001504 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001505 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001506 const char* const* ppEnabledExtensionNames
1507 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001508}
1509
1510class VkInstanceCreateInfo {
1511 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1512 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001513 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001514 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001515 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001516 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001517 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001518 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1519}
1520
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001521class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001522 VkQueueFlags queueFlags /// Queue flags
1523 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001524 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001525 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001526}
1527
1528class VkPhysicalDeviceMemoryProperties {
1529 u32 memoryTypeCount
1530 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1531 u32 memoryHeapCount
1532 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1533}
1534
Jesse Hall3fbc8562015-11-29 22:10:52 -08001535class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001536 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001537 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001538 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001539 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1540}
1541
1542class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001543 VkDeviceSize size /// Specified in bytes
1544 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001545 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1546}
1547
1548class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001549 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001550 VkExtent3D imageGranularity
1551 VkSparseImageFormatFlags flags
1552}
1553
1554class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001555 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001556 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001557 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1558 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1559 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001560}
1561
1562class VkMemoryType {
1563 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1564 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1565}
1566
1567class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001568 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001569 VkMemoryHeapFlags flags /// Flags for the heap
1570}
1571
1572class VkMappedMemoryRange {
1573 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1574 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001575 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001576 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1577 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001578}
1579
1580class VkFormatProperties {
1581 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1582 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001583 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001584}
1585
1586class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001587 VkExtent3D maxExtent /// max image dimensions for this resource type
1588 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001589 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001590 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1591 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1592}
1593
Jesse Halla15a4bf2015-11-19 22:48:02 -08001594class VkDescriptorImageInfo {
1595 VkSampler sampler
1596 VkImageView imageView
1597 VkImageLayout imageLayout
1598}
1599
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001600class VkDescriptorBufferInfo {
1601 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1602 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1603 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001604}
1605
Jesse Halld27f6aa2015-08-15 17:58:48 -07001606class VkWriteDescriptorSet {
1607 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1608 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001609 VkDescriptorSet dstSet /// Destination descriptor set
1610 u32 dstBinding /// Binding within the destination descriptor set to write
1611 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001612 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001613 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 -08001614 const VkDescriptorImageInfo* pImageInfo
1615 const VkDescriptorBufferInfo* pBufferInfo
1616 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001617}
1618
1619class VkCopyDescriptorSet {
1620 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1621 const void* pNext /// Pointer to next structure
1622 VkDescriptorSet srcSet /// Source descriptor set
1623 u32 srcBinding /// Binding within the source descriptor set to copy from
1624 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001625 VkDescriptorSet dstSet /// Destination descriptor set
1626 u32 dstBinding /// Binding within the destination descriptor set to copy to
1627 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001628 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001629}
1630
1631class VkBufferCreateInfo {
1632 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1633 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001634 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001635 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001636 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001637 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001638 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001639 const u32* pQueueFamilyIndices
1640}
1641
1642class VkBufferViewCreateInfo {
1643 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1644 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001645 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001646 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001647 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001648 VkDeviceSize offset /// Specified in bytes
1649 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001650}
1651
1652class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001653 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001654 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001655 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001656}
1657
1658class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001659 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001660 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001661 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001662 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001663 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001664}
1665
1666class VkMemoryBarrier {
1667 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1668 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001669 VkAccessFlags srcAccessMask
1670 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001671}
1672
1673class VkBufferMemoryBarrier {
1674 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1675 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001676 VkAccessFlags srcAccessMask
1677 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001678 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001679 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001680 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001681 VkDeviceSize offset /// Offset within the buffer to sync
1682 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001683}
1684
1685class VkImageMemoryBarrier {
1686 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1687 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001688 VkAccessFlags srcAccessMask
1689 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001690 VkImageLayout oldLayout /// Current layout of the image
1691 VkImageLayout newLayout /// New layout to transition the image to
1692 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001693 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001694 VkImage image /// Image to sync
1695 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1696}
1697
1698class VkImageCreateInfo {
1699 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1700 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001701 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001702 VkImageType imageType
1703 VkFormat format
1704 VkExtent3D extent
1705 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001706 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001707 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001708 VkImageTiling tiling
1709 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001710 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001711 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001712 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001713 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001714}
1715
1716class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001717 VkDeviceSize offset /// Specified in bytes
1718 VkDeviceSize size /// Specified in bytes
1719 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001720 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001721 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001722}
1723
1724class VkImageViewCreateInfo {
1725 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1726 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001727 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001728 VkImage image
1729 VkImageViewType viewType
1730 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001731 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001732 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001733}
1734
1735class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001736 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001737 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001738 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001739}
1740
Jesse Halla6429252015-11-29 18:59:42 -08001741class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001742 VkDeviceSize resourceOffset /// Specified in bytes
1743 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001744 VkDeviceMemory memory
1745 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001746 VkSparseMemoryBindFlags flags
1747}
1748
Jesse Halla6429252015-11-29 18:59:42 -08001749class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001750 VkImageSubresource subresource
1751 VkOffset3D offset
1752 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001753 VkDeviceMemory memory
1754 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001755 VkSparseMemoryBindFlags flags
1756}
1757
Jesse Halla6429252015-11-29 18:59:42 -08001758class VkSparseBufferMemoryBindInfo {
1759 VkBuffer buffer
1760 u32 bindCount
1761 const VkSparseMemoryBind* pBinds
1762}
1763
1764class VkSparseImageOpaqueMemoryBindInfo {
1765 VkImage image
1766 u32 bindCount
1767 const VkSparseMemoryBind* pBinds
1768}
1769
1770class VkSparseImageMemoryBindInfo {
1771 VkImage image
1772 u32 bindCount
1773 const VkSparseMemoryBind* pBinds
1774}
1775
1776class VkBindSparseInfo {
1777 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1778 const void* pNext
1779 u32 waitSemaphoreCount
1780 const VkSemaphore* pWaitSemaphores
1781 u32 numBufferBinds
1782 const VkSparseBufferMemoryBindInfo* pBufferBinds
1783 u32 numImageOpaqueBinds
1784 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1785 u32 numImageBinds
1786 const VkSparseImageMemoryBindInfo* pImageBinds
1787 u32 signalSemaphoreCount
1788 const VkSemaphore* pSignalSemaphores
1789}
1790
Jesse Hall65ab5522015-11-30 00:07:16 -08001791class VkImageSubresourceLayers {
1792 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001793 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001794 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001795 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001796}
1797
Jesse Halld27f6aa2015-08-15 17:58:48 -07001798class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001799 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001800 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001801 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001802 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001803 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1804}
1805
1806class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001807 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001808 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08001809 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001810 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07001811}
1812
1813class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001814 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001815 u32 bufferRowLength /// Specified in texels
1816 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001817 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001818 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1819 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1820}
1821
1822class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001823 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001824 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001825 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001826 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001827 VkExtent3D extent
1828}
1829
1830class VkShaderModuleCreateInfo {
1831 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1832 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001833 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001834 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08001835 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07001836}
1837
Jesse Halld27f6aa2015-08-15 17:58:48 -07001838class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08001839 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001840 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08001841 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001842 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
1843 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
1844}
1845
1846class VkDescriptorSetLayoutCreateInfo {
1847 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
1848 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001849 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001850 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08001851 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001852}
1853
Jesse Hall65ab5522015-11-30 00:07:16 -08001854class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001855 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08001856 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001857}
1858
1859class VkDescriptorPoolCreateInfo {
1860 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
1861 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08001862 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001863 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08001864 u32 poolSizeCount
1865 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001866}
1867
Jesse Hall3fbc8562015-11-29 22:10:52 -08001868class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001869 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08001870 const void* pNext /// Pointer to next structure
1871 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08001872 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001873 const VkDescriptorSetLayout* pSetLayouts
1874}
1875
Jesse Halld27f6aa2015-08-15 17:58:48 -07001876class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08001877 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07001878 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08001879 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07001880}
1881
1882class VkSpecializationInfo {
1883 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08001884 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07001885 platform.size_t dataSize /// Size in bytes of pData
1886 const void* pData /// Pointer to SpecConstant data
1887}
1888
1889class VkPipelineShaderStageCreateInfo {
1890 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
1891 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001892 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001893 VkShaderStageFlagBits stage
1894 VkShaderModule module
1895 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07001896 const VkSpecializationInfo* pSpecializationInfo
1897}
1898
1899class VkComputePipelineCreateInfo {
1900 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
1901 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001902 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001903 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001904 VkPipelineLayout layout /// Interface layout of the pipeline
1905 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
1906 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
1907}
1908
1909class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001910 u32 binding /// Vertex buffer binding id
1911 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08001912 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07001913}
1914
1915class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001916 u32 location /// location of the shader vertex attrib
1917 u32 binding /// Vertex buffer binding id
1918 VkFormat format /// format of source data
1919 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001920}
1921
1922class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001923 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
1924 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001925 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001926 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001927 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08001928 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001929 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1930}
1931
1932class VkPipelineInputAssemblyStateCreateInfo {
1933 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
1934 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001935 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001936 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001937 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001938}
1939
1940class VkPipelineTessellationStateCreateInfo {
1941 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
1942 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001943 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001944 u32 patchControlPoints
1945}
1946
1947class VkPipelineViewportStateCreateInfo {
1948 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
1949 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001950 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001951 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001952 const VkViewport* pViewports
1953 u32 scissorCount
1954 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07001955}
1956
Jesse Hall3fbc8562015-11-29 22:10:52 -08001957class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08001958 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001959 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001960 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001961 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001962 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001963 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08001964 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07001965 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001966 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08001967 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001968 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08001969 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001970 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001971}
1972
1973class VkPipelineMultisampleStateCreateInfo {
1974 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
1975 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001976 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001977 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001978 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001979 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001980 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08001981 VkBool32 alphaToCoverageEnable
1982 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001983}
1984
1985class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001986 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001987 VkBlendFactor srcColorBlendFactor
1988 VkBlendFactor dstColorBlendFactor
1989 VkBlendOp colorBlendOp
1990 VkBlendFactor srcAlphaBlendFactor
1991 VkBlendFactor dstAlphaBlendFactor
1992 VkBlendOp alphaBlendOp
1993 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001994}
1995
1996class VkPipelineColorBlendStateCreateInfo {
1997 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
1998 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001999 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002000 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002001 VkLogicOp logicOp
2002 u32 attachmentCount /// # of pAttachments
2003 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002004 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002005}
2006
2007class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002008 VkStencilOp failOp
2009 VkStencilOp passOp
2010 VkStencilOp depthFailOp
2011 VkCompareOp compareOp
2012 u32 compareMask
2013 u32 writeMask
2014 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002015}
2016
2017class VkPipelineDepthStencilStateCreateInfo {
2018 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2019 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002020 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002021 VkBool32 depthTestEnable
2022 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002023 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002024 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2025 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002026 VkStencilOpState front
2027 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002028 f32 minDepthBounds
2029 f32 maxDepthBounds
2030}
2031
2032class VkPipelineDynamicStateCreateInfo {
2033 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2034 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002035 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002036 u32 dynamicStateCount
2037 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002038}
2039
2040class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002041 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2042 const void* pNext /// Pointer to next structure
2043 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002044 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002045 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002046 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2047 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2048 const VkPipelineTessellationStateCreateInfo* pTessellationState
2049 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002050 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002051 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2052 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2053 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002054 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002055 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002056 VkRenderPass renderPass
2057 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002058 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
2059 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 -07002060}
2061
2062class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002063 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2064 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002065 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002066 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2067 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002068}
2069
2070class VkPushConstantRange {
2071 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002072 u32 offset /// Start of the range, in bytes
2073 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002074}
2075
2076class VkPipelineLayoutCreateInfo {
2077 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2078 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002079 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002080 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002081 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2082 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2083 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2084}
2085
2086class VkSamplerCreateInfo {
2087 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2088 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002089 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002090 VkFilter magFilter /// Filter mode for magnification
2091 VkFilter minFilter /// Filter mode for minifiation
2092 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2093 VkSamplerAddressMode addressModeU
2094 VkSamplerAddressMode addressModeV
2095 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002096 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002097 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002098 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002099 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002100 VkCompareOp compareOp
2101 f32 minLod
2102 f32 maxLod
2103 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002104 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002105}
2106
Jesse Hall3fbc8562015-11-29 22:10:52 -08002107class VkCommandPoolCreateInfo {
2108 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002109 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002110 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002111 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002112}
2113
Jesse Hall3fbc8562015-11-29 22:10:52 -08002114class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002115 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002116 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002117 VkCommandPool commandPool
2118 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002119 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002120}
2121
Jesse Hall3dd678a2016-01-08 21:52:01 -08002122class VkCommandBufferInheritanceInfo {
2123 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002124 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002125 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002126 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002127 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002128 VkBool32 occlusionQueryEnable
2129 VkQueryControlFlags queryFlags
2130 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002131}
2132
Jesse Hall3dd678a2016-01-08 21:52:01 -08002133class VkCommandBufferBeginInfo {
2134 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2135 const void* pNext /// Pointer to next structure
2136 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2137 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2138}
2139
Jesse Halld27f6aa2015-08-15 17:58:48 -07002140class VkRenderPassBeginInfo {
2141 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2142 const void* pNext /// Pointer to next structure
2143 VkRenderPass renderPass
2144 VkFramebuffer framebuffer
2145 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002146 u32 clearValueCount
2147 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002148}
2149
2150@union
2151/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2152class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002153 f32[4] float32
2154 s32[4] int32
2155 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002156}
2157
2158class VkClearDepthStencilValue {
2159 f32 depth
2160 u32 stencil
2161}
2162
2163@union
2164/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2165class VkClearValue {
2166 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002167 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002168}
2169
Jesse Hallae38f732015-11-19 21:32:50 -08002170class VkClearAttachment {
2171 VkImageAspectFlags aspectMask
2172 u32 colorAttachment
2173 VkClearValue clearValue
2174}
2175
Jesse Halld27f6aa2015-08-15 17:58:48 -07002176class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002177 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002178 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002179 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002180 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2181 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2182 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2183 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2184 VkImageLayout initialLayout
2185 VkImageLayout finalLayout
2186}
2187
2188class VkAttachmentReference {
2189 u32 attachment
2190 VkImageLayout layout
2191}
2192
2193class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002194 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002195 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002196 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002197 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002198 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002199 const VkAttachmentReference* pColorAttachments
2200 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002201 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002202 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002203 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002204}
2205
2206class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002207 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002208 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002209 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002210 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002211 VkAccessFlags srcAccessMask
2212 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002213 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002214}
2215
2216class VkRenderPassCreateInfo {
2217 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2218 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002219 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002220 u32 attachmentCount
2221 const VkAttachmentDescription* pAttachments
2222 u32 subpassCount
2223 const VkSubpassDescription* pSubpasses
2224 u32 dependencyCount
2225 const VkSubpassDependency* pDependencies
2226}
2227
2228class VkEventCreateInfo {
2229 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2230 const void* pNext /// Pointer to next structure
2231 VkEventCreateFlags flags /// Event creation flags
2232}
2233
2234class VkFenceCreateInfo {
2235 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2236 const void* pNext /// Pointer to next structure
2237 VkFenceCreateFlags flags /// Fence creation flags
2238}
2239
2240class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002241 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2242 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2243 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2244 VkBool32 independentBlend /// blending operations are controlled per-attachment
2245 VkBool32 geometryShader /// geometry stage
2246 VkBool32 tessellationShader /// tessellation control and evaluation stage
2247 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002248 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002249 VkBool32 logicOp /// logic operations
2250 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002251 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002252 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002253 VkBool32 depthBiasClamp /// depth bias clamping
2254 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2255 VkBool32 depthBounds /// depth bounds test
2256 VkBool32 wideLines /// lines with width greater than 1
2257 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002258 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2259 VkBool32 multiViewport
2260 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002261 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2262 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2263 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002264 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002265 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002266 VkBool32 vertexPipelineStoresAndAtomics
2267 VkBool32 fragmentStoresAndAtomics
2268 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002269 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2270 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2271 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002272 VkBool32 shaderStorageImageReadWithoutFormat
2273 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002274 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2275 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2276 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2277 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2278 VkBool32 shaderClipDistance /// clip distance in shaders
2279 VkBool32 shaderCullDistance /// cull distance in shaders
2280 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2281 VkBool32 shaderInt64 /// 64-bit integers in shaders
2282 VkBool32 shaderInt16 /// 16-bit integers in shaders
2283 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002284 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002285 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2286 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2287 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2288 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2289 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2290 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2291 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2292 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2293 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002294 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002295 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002296}
2297
2298class VkPhysicalDeviceLimits {
2299 /// resource maximum sizes
2300 u32 maxImageDimension1D /// max 1D image dimension
2301 u32 maxImageDimension2D /// max 2D image dimension
2302 u32 maxImageDimension3D /// max 3D image dimension
2303 u32 maxImageDimensionCube /// max cubemap image dimension
2304 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002305 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002306 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2307 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002308 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2309 /// memory limits
2310 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002311 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002312 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2313 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002314 /// descriptor set limits
2315 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002316 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2317 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2318 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2319 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2320 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002321 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002322 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002323 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2324 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002325 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002326 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002327 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002328 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2329 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002330 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002331 /// vertex stage limits
2332 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002333 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002334 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2335 u32 maxVertexInputBindingStride /// max vertex input binding stride
2336 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2337 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002338 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002339 u32 maxTessellationPatchSize /// max patch size (vertices)
2340 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2341 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2342 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2343 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2344 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2345 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002346 /// geometry stage limits
2347 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2348 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2349 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2350 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2351 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2352 /// fragment stage limits
2353 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002354 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002355 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002356 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2357 /// compute stage limits
2358 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2359 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2360 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2361 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2362
2363 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2364 u32 subTexelPrecisionBits /// num bits of subtexel precision
2365 u32 mipmapPrecisionBits /// num bits of mipmap precision
2366
2367 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002368 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002369
2370 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2371 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2372
2373 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002374 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2375 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2376 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2377
Jesse Halldc6d36c2015-11-29 19:12:15 -08002378 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2379 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2380 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2381 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002382
Jesse Hallfbf97b02015-11-20 14:17:03 -08002383 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002384 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002385 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002386 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2387 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2388 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2389 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2390
2391 u32 maxFramebufferWidth /// max width for a framebuffer
2392 u32 maxFramebufferHeight /// max height for a framebuffer
2393 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002394 VkSampleCountFlags framebufferColorSampleCounts
2395 VkSampleCountFlags framebufferDepthSampleCounts
2396 VkSampleCountFlags framebufferStencilSampleCounts
2397 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002398 u32 maxColorAttachments /// max num of framebuffer color attachments
2399
Jesse Hall091ed9e2015-11-30 00:55:29 -08002400 VkSampleCountFlags sampledImageColorSampleCounts
2401 VkSampleCountFlags sampledImageIntegerSampleCounts
2402 VkSampleCountFlags sampledImageDepthSampleCounts
2403 VkSampleCountFlags sampledImageStencilSampleCounts
2404 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002405 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002406 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002407
Jesse Halla9bb62b2015-11-21 19:31:56 -08002408 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002409
2410 u32 maxClipDistances /// max number of clip distances
2411 u32 maxCullDistances /// max number of cull distances
2412 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2413
Jesse Hallfbf97b02015-11-20 14:17:03 -08002414 u32 discreteQueuePriorities
2415
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002416 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2417 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002418 f32 pointSizeGranularity /// granularity of supported point sizes
2419 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002420 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002421 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002422
Jesse Hall65ab5522015-11-30 00:07:16 -08002423 VkDeviceSize optimalBufferCopyOffsetAlignment
2424 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002425 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002426}
2427
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002428class VkPhysicalDeviceSparseProperties {
2429 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 -08002430 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 -07002431 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2432 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 -07002433 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
2434}
2435
Jesse Halld27f6aa2015-08-15 17:58:48 -07002436class VkSemaphoreCreateInfo {
2437 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2438 const void* pNext /// Pointer to next structure
2439 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2440}
2441
2442class VkQueryPoolCreateInfo {
2443 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2444 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002445 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002446 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002447 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002448 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2449}
2450
2451class VkFramebufferCreateInfo {
2452 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2453 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002454 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002455 VkRenderPass renderPass
2456 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002457 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002458 u32 width
2459 u32 height
2460 u32 layers
2461}
2462
Jesse Hall3fbc8562015-11-29 22:10:52 -08002463class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002464 u32 vertexCount
2465 u32 instanceCount
2466 u32 firstVertex
2467 u32 firstInstance
2468}
2469
Jesse Hall3fbc8562015-11-29 22:10:52 -08002470class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002471 u32 indexCount
2472 u32 instanceCount
2473 u32 firstIndex
2474 s32 vertexOffset
2475 u32 firstInstance
2476}
2477
Jesse Hall3fbc8562015-11-29 22:10:52 -08002478class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002479 u32 x
2480 u32 y
2481 u32 z
2482}
2483
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002484@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002485class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002486 u32 minImageCount
2487 u32 maxImageCount
2488 VkExtent2D currentExtent
2489 VkExtent2D minImageExtent
2490 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002491 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002492 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002493 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002494 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002495 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002496}
2497
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002498@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002499class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002500 VkFormat format
2501 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002502}
2503
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002504@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002505class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002506 VkStructureType sType
2507 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002508 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002509 VkSurfaceKHR surface
2510 u32 minImageCount
2511 VkFormat imageFormat
2512 VkColorSpaceKHR imageColorSpace
2513 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002514 u32 imageArrayLayers
2515 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002516 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002517 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002518 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002519 VkSurfaceTransformFlagBitsKHR preTransform
2520 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002521 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002522 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002523 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002524}
2525
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002526@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002527class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002528 VkStructureType sType
2529 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002530 u32 waitSemaphoreCount
2531 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002532 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002533 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002534 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002535 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002536}
2537
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002538@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002539class VkDisplayPropertiesKHR {
2540 VkDisplayKHR display
2541 const char* displayName
2542 VkExtent2D physicalDimensions
2543 VkExtent2D physicalResolution
2544 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002545 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002546 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002547}
2548
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002549@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002550class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002551 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002552 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002553}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002554
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002555@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002556class VkDisplayModePropertiesKHR {
2557 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002558 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002559}
2560
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002561@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002562class VkDisplayModeCreateInfoKHR {
2563 VkStructureType sType
2564 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002565 VkDisplayModeCreateFlagsKHR flags
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 VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002571 VkDisplayKHR currentDisplay
2572 u32 currentStackIndex
2573}
2574
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002575@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002576class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002577 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2578 VkOffset2D minSrcPosition
2579 VkOffset2D maxSrcPosition
2580 VkExtent2D minSrcExtent
2581 VkExtent2D maxSrcExtent
2582 VkOffset2D minDstPosition
2583 VkOffset2D maxDstPosition
2584 VkExtent2D minDstExtent
2585 VkExtent2D maxDstExtent
2586}
2587
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002588@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002589class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002590 VkStructureType sType
2591 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002592 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002593 VkDisplayModeKHR displayMode
2594 u32 planeIndex
2595 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002596 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002597 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002598 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2599 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002600}
2601
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002602@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002603class VkDisplayPresentInfoKHR {
2604 VkStructureType sType
2605 const void* pNext
2606 VkRect2D srcRect
2607 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002608 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002609}
2610
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002611@extension("VK_KHR_xlib_surface")
2612class VkXlibSurfaceCreateInfoKHR {
2613 VkStructureType sType
2614 const void* pNext
2615 VkXlibSurfaceCreateFlagsKHR flags
2616 platform.Display* dpy
2617 platform.Window window
2618}
2619
2620@extension("VK_KHR_xcb_surface")
2621class VkXcbSurfaceCreateInfoKHR {
2622 VkStructureType sType
2623 const void* pNext
2624 VkXcbSurfaceCreateFlagsKHR flags
2625 platform.xcb_connection_t* connection
2626 platform.xcb_window_t window
2627}
2628
2629@extension("VK_KHR_wayland_surface")
2630class VkWaylandSurfaceCreateInfoKHR {
2631 VkStructureType sType
2632 const void* pNext
2633 VkWaylandSurfaceCreateFlagsKHR flags
2634 platform.wl_display* display
2635 platform.wl_surface* surface
2636}
2637
2638@extension("VK_KHR_mir_surface")
2639class VkMirSurfaceCreateInfoKHR {
2640 VkStructureType sType
2641 const void* pNext
2642 VkMirSurfaceCreateFlagsKHR flags
2643 platform.MirConnection* connection
2644 platform.MirSurface* mirSurface
2645}
2646
2647@extension("VK_KHR_android_surface")
2648class VkAndroidSurfaceCreateInfoKHR {
2649 VkStructureType sType
2650 const void* pNext
2651 VkAndroidSurfaceCreateFlagsKHR flags
2652 platform.ANativeWindow* window
2653}
2654
2655@extension("VK_KHR_win32_surface")
2656class VkWin32SurfaceCreateInfoKHR {
2657 VkStructureType sType
2658 const void* pNext
2659 VkWin32SurfaceCreateFlagsKHR flags
2660 platform.HINSTANCE hinstance
2661 platform.HWND hwnd
2662}
2663
Chia-I Wub262ddc2016-03-22 07:38:20 +08002664@extension("VK_ANDROID_native_buffer")
2665class VkNativeBufferANDROID {
2666 VkStructureType sType
2667 const void* pNext
2668 platform.buffer_handle_t handle
2669 int stride
2670 int format
2671 int usage
2672}
2673
Jesse Hall715b86a2016-01-16 16:34:29 -08002674@extension("VK_EXT_debug_report")
2675class VkDebugReportCallbackCreateInfoEXT {
2676 VkStructureType sType
2677 const void* pNext
2678 VkDebugReportFlagsEXT flags
2679 PFN_vkDebugReportCallbackEXT pfnCallback
2680 void* pUserData
2681}
2682
Jesse Hall26763382016-05-20 07:13:52 -07002683@extension("VK_AMD_rasterization_order")
2684class VkPipelineRasterizationStateRasterizationOrderAMD {
2685 VkStructureType sType
2686 const void* pNext
2687 VkRasterizationOrderAMD rasterizationOrder
2688}
2689
2690@extension("VK_EXT_debug_marker")
2691class VkDebugMarkerObjectNameInfoEXT {
2692 VkStructureType sType
2693 const void* pNext
2694 VkDebugReportObjectTypeEXT objectType
2695 u64 object
2696 const char* pObjectName
2697}
2698
2699@extension("VK_EXT_debug_marker")
2700class VkDebugMarkerObjectTagInfoEXT {
2701 VkStructureType sType
2702 const void* pNext
2703 VkDebugReportObjectTypeEXT objectType
2704 u64 object
2705 u64 tagName
2706 platform.size_t tagSize
2707 const void* pTag
2708}
2709
2710@extension("VK_EXT_debug_marker")
2711class VkDebugMarkerMarkerInfoEXT {
2712 VkStructureType sType
2713 const void* pNext
2714 const char* pMarkerName
2715 f32[4] color
2716}
2717
Jesse Hall56d386a2016-07-26 15:20:40 -07002718@extension("VK_NV_dedicated_allocation")
2719class VkDedicatedAllocationImageCreateInfoNV {
2720 VkStructureType sType
2721 const void* pNext
2722 VkBool32 dedicatedAllocation
2723}
2724
2725@extension("VK_NV_dedicated_allocation")
2726class VkDedicatedAllocationBufferCreateInfoNV {
2727 VkStructureType sType
2728 const void* pNext
2729 VkBool32 dedicatedAllocation
2730}
2731
2732@extension("VK_NV_dedicated_allocation")
2733class VkDedicatedAllocationMemoryAllocateInfoNV {
2734 VkStructureType sType
2735 const void* pNext
2736 VkImage image
2737 VkBuffer buffer
2738}
2739
Jesse Hall1356b0d2015-11-23 17:24:58 -08002740
Jesse Halld27f6aa2015-08-15 17:58:48 -07002741////////////////
2742// Commands //
2743////////////////
2744
2745// Function pointers. TODO: add support for function pointers.
2746
2747@external type void* PFN_vkVoidFunction
2748@pfn cmd void vkVoidFunction() {
2749}
2750
Jesse Hall3fbc8562015-11-29 22:10:52 -08002751@external type void* PFN_vkAllocationFunction
2752@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002753 void* pUserData,
2754 platform.size_t size,
2755 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002756 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002757 return ?
2758}
2759
Jesse Hall3fbc8562015-11-29 22:10:52 -08002760@external type void* PFN_vkReallocationFunction
2761@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002762 void* pUserData,
2763 void* pOriginal,
2764 platform.size_t size,
2765 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002766 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002767 return ?
2768}
2769
2770@external type void* PFN_vkFreeFunction
2771@pfn cmd void vkFreeFunction(
2772 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002773 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002774}
2775
Jesse Hall3fbc8562015-11-29 22:10:52 -08002776@external type void* PFN_vkInternalAllocationNotification
2777@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002778 void* pUserData,
2779 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002780 VkInternalAllocationType allocationType,
2781 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002782}
2783
2784@external type void* PFN_vkInternalFreeNotification
2785@pfn cmd void vkInternalFreeNotification(
2786 void* pUserData,
2787 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002788 VkInternalAllocationType allocationType,
2789 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002790}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002791
2792// Global functions
2793
2794@threadSafety("system")
2795cmd VkResult vkCreateInstance(
2796 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002797 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002798 VkInstance* pInstance) {
2799 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
2800
2801 instance := ?
2802 pInstance[0] = instance
2803 State.Instances[instance] = new!InstanceObject()
2804
Jesse Hall3dd678a2016-01-08 21:52:01 -08002805 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
2806 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07002807
2808 return ?
2809}
2810
2811@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002812cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002813 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002814 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002815 instanceObject := GetInstance(instance)
2816
2817 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002818}
2819
2820@threadSafety("system")
2821cmd VkResult vkEnumeratePhysicalDevices(
2822 VkInstance instance,
2823 u32* pPhysicalDeviceCount,
2824 VkPhysicalDevice* pPhysicalDevices) {
2825 instanceObject := GetInstance(instance)
2826
2827 physicalDeviceCount := as!u32(?)
2828 pPhysicalDeviceCount[0] = physicalDeviceCount
2829 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
2830
2831 for i in (0 .. physicalDeviceCount) {
2832 physicalDevice := ?
2833 physicalDevices[i] = physicalDevice
2834 if !(physicalDevice in State.PhysicalDevices) {
2835 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
2836 }
2837 }
2838
2839 return ?
2840}
2841
2842cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
2843 VkDevice device,
2844 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002845 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002846 device := GetDevice(device)
2847 }
2848
2849 return ?
2850}
2851
2852cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
2853 VkInstance instance,
2854 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002855 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002856 instanceObject := GetInstance(instance)
2857 }
2858
2859 return ?
2860}
2861
Jesse Hall606a54e2015-11-19 22:17:28 -08002862cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002863 VkPhysicalDevice physicalDevice,
2864 VkPhysicalDeviceProperties* pProperties) {
2865 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2866
2867 properties := ?
2868 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002869}
2870
Jesse Hall606a54e2015-11-19 22:17:28 -08002871cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002872 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002873 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002874 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002875 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002876 // TODO: Figure out how to express fetch-count-or-properties
2877 // This version fails 'apic validate' with 'fence not allowed in
2878 // *semantic.Branch'. Other attempts have failed with the same or other
2879 // errors.
2880 // if pQueueFamilyProperties != null {
2881 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
2882 // for i in (0 .. pCount[0]) {
2883 // queueProperties := as!VkQueueFamilyProperties(?)
2884 // queuesProperties[i] = queueProperties
2885 // }
2886 // } else {
2887 // count := ?
2888 // pCount[0] = count
2889 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002890}
2891
Jesse Hall606a54e2015-11-19 22:17:28 -08002892cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002893 VkPhysicalDevice physicalDevice,
2894 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
2895 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2896
2897 memoryProperties := ?
2898 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002899}
2900
Jesse Hall606a54e2015-11-19 22:17:28 -08002901cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002902 VkPhysicalDevice physicalDevice,
2903 VkPhysicalDeviceFeatures* pFeatures) {
2904 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2905
2906 features := ?
2907 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07002908}
2909
Jesse Hall606a54e2015-11-19 22:17:28 -08002910cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002911 VkPhysicalDevice physicalDevice,
2912 VkFormat format,
2913 VkFormatProperties* pFormatProperties) {
2914 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2915
2916 formatProperties := ?
2917 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002918}
2919
Jesse Halla9e57032015-11-30 01:03:10 -08002920cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002921 VkPhysicalDevice physicalDevice,
2922 VkFormat format,
2923 VkImageType type,
2924 VkImageTiling tiling,
2925 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002926 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002927 VkImageFormatProperties* pImageFormatProperties) {
2928 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2929
2930 imageFormatProperties := ?
2931 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08002932
2933 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07002934}
2935
Jesse Halld27f6aa2015-08-15 17:58:48 -07002936
2937// Device functions
2938
2939@threadSafety("system")
2940cmd VkResult vkCreateDevice(
2941 VkPhysicalDevice physicalDevice,
2942 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002943 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002944 VkDevice* pDevice) {
2945 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
2946 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2947
2948 device := ?
2949 pDevice[0] = device
2950 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
2951
2952 return ?
2953}
2954
2955@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002956cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002957 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002958 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002959 deviceObject := GetDevice(device)
2960
2961 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002962}
2963
2964
2965// Extension discovery functions
2966
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002967cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002968 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002969 VkLayerProperties* pProperties) {
2970 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002971 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002972
2973 properties := pProperties[0:count]
2974 for i in (0 .. count) {
2975 property := ?
2976 properties[i] = property
2977 }
2978
2979 return ?
2980}
2981
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002982cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002983 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002984 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002985 VkExtensionProperties* pProperties) {
2986 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002987 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002988
2989 properties := pProperties[0:count]
2990 for i in (0 .. count) {
2991 property := ?
2992 properties[i] = property
2993 }
2994
2995 return ?
2996}
2997
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002998cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002999 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003000 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003001 VkLayerProperties* pProperties) {
3002 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3003 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003004 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003005
3006 properties := pProperties[0:count]
3007 for i in (0 .. count) {
3008 property := ?
3009 properties[i] = property
3010 }
3011
3012 return ?
3013}
3014
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003015cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003016 VkPhysicalDevice physicalDevice,
3017 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003018 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003019 VkExtensionProperties* pProperties) {
3020 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3021
3022 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003023 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003024
3025 properties := pProperties[0:count]
3026 for i in (0 .. count) {
3027 property := ?
3028 properties[i] = property
3029 }
3030
3031 return ?
3032}
3033
3034
3035// Queue functions
3036
3037@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003038cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003039 VkDevice device,
3040 u32 queueFamilyIndex,
3041 u32 queueIndex,
3042 VkQueue* pQueue) {
3043 deviceObject := GetDevice(device)
3044
3045 queue := ?
3046 pQueue[0] = queue
3047
3048 if !(queue in State.Queues) {
3049 State.Queues[queue] = new!QueueObject(device: device)
3050 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003051}
3052
3053@threadSafety("app")
3054cmd VkResult vkQueueSubmit(
3055 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003056 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003057 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003058 VkFence fence) {
3059 queueObject := GetQueue(queue)
3060
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003061 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003062 fenceObject := GetFence(fence)
3063 assert(fenceObject.device == queueObject.device)
3064 }
3065
Jesse Hall3fbc8562015-11-29 22:10:52 -08003066 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3067 // for i in (0 .. commandBufferCount) {
3068 // commandBuffer := commandBuffers[i]
3069 // commandBufferObject := GetCommandBuffer(commandBuffer)
3070 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003071 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003072 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3073 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003074 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003075
3076 return ?
3077}
3078
3079@threadSafety("system")
3080cmd VkResult vkQueueWaitIdle(
3081 VkQueue queue) {
3082 queueObject := GetQueue(queue)
3083
3084 return ?
3085}
3086
3087@threadSafety("system")
3088cmd VkResult vkDeviceWaitIdle(
3089 VkDevice device) {
3090 deviceObject := GetDevice(device)
3091
3092 return ?
3093}
3094
3095
3096// Memory functions
3097
3098@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003099cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003100 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003101 const VkMemoryAllocateInfo* pAllocateInfo,
3102 const VkAllocationCallbacks* pAllocator,
3103 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003104 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003105 deviceObject := GetDevice(device)
3106
Jesse Hall3fbc8562015-11-29 22:10:52 -08003107 memory := ?
3108 pMemory[0] = memory
3109 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003110 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003111 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003112
3113 return ?
3114}
3115
3116@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003117cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003118 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003119 VkDeviceMemory memory,
3120 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003121 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003122 memoryObject := GetDeviceMemory(memory)
3123 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003124
3125 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003126 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003127 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003128 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3129 "vkFreeMemory: commandBuffers still bound")
3130 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003131}
3132
3133@threadSafety("app")
3134cmd VkResult vkMapMemory(
3135 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003136 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003137 VkDeviceSize offset,
3138 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003139 VkMemoryMapFlags flags,
3140 void** ppData) {
3141 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003142 memoryObject := GetDeviceMemory(memory)
3143 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003144
3145 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003146 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003147
3148 return ?
3149}
3150
3151@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003152cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003153 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003154 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003155 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003156 memoryObject := GetDeviceMemory(memory)
3157 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003158}
3159
3160cmd VkResult vkFlushMappedMemoryRanges(
3161 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003162 u32 memoryRangeCount
3163 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003164 deviceObject := GetDevice(device)
3165
Jesse Hall3fbc8562015-11-29 22:10:52 -08003166 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3167 for i in (0 .. memoryRangeCount) {
3168 memoryRange := memoryRanges[i]
3169 memoryObject := GetDeviceMemory(memoryRange.memory)
3170 assert(memoryObject.device == device)
3171 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003172 }
3173
3174 return ?
3175}
3176
3177cmd VkResult vkInvalidateMappedMemoryRanges(
3178 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003179 u32 memoryRangeCount,
3180 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003181 deviceObject := GetDevice(device)
3182
Jesse Hall3fbc8562015-11-29 22:10:52 -08003183 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3184 for i in (0 .. memoryRangeCount) {
3185 memoryRange := memoryRanges[i]
3186 memoryObject := GetDeviceMemory(memoryRange.memory)
3187 assert(memoryObject.device == device)
3188 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003189 }
3190
3191 return ?
3192}
3193
3194
3195// Memory management API functions
3196
Jesse Hall606a54e2015-11-19 22:17:28 -08003197cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003198 VkDevice device,
3199 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003200 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003201 deviceObject := GetDevice(device)
3202
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003203 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003204 memoryObject := GetDeviceMemory(memory)
3205 assert(memoryObject.device == device)
3206 }
3207
3208 committedMemoryInBytes := ?
3209 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003210}
3211
Jesse Hall606a54e2015-11-19 22:17:28 -08003212cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003213 VkDevice device,
3214 VkBuffer buffer,
3215 VkMemoryRequirements* pMemoryRequirements) {
3216 deviceObject := GetDevice(device)
3217 bufferObject := GetBuffer(buffer)
3218 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003219}
3220
3221cmd VkResult vkBindBufferMemory(
3222 VkDevice device,
3223 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003224 VkDeviceMemory memory,
3225 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003226 deviceObject := GetDevice(device)
3227 bufferObject := GetBuffer(buffer)
3228 assert(bufferObject.device == device)
3229
3230 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003231 if bufferObject.memory != NULL_HANDLE {
3232 memoryObject := GetDeviceMemory(bufferObject.memory)
3233 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003234 }
3235
3236 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003237 if memory != NULL_HANDLE {
3238 memoryObject := GetDeviceMemory(memory)
3239 assert(memoryObject.device == device)
3240 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003241 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003242 bufferObject.memory = memory
3243 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003244
3245 return ?
3246}
3247
Jesse Hall606a54e2015-11-19 22:17:28 -08003248cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003249 VkDevice device,
3250 VkImage image,
3251 VkMemoryRequirements* pMemoryRequirements) {
3252 deviceObject := GetDevice(device)
3253 imageObject := GetImage(image)
3254 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003255}
3256
3257cmd VkResult vkBindImageMemory(
3258 VkDevice device,
3259 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003260 VkDeviceMemory memory,
3261 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003262 deviceObject := GetDevice(device)
3263 imageObject := GetImage(image)
3264 assert(imageObject.device == device)
3265
3266 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003267 if imageObject.memory != NULL_HANDLE {
3268 memoryObject := GetDeviceMemory(imageObject.memory)
3269 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003270 }
3271
3272 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003273 if memory != NULL_HANDLE {
3274 memoryObject := GetDeviceMemory(memory)
3275 assert(memoryObject.device == device)
3276 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003277 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003278 imageObject.memory = memory
3279 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003280
3281 return ?
3282}
3283
Jesse Hall606a54e2015-11-19 22:17:28 -08003284cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003285 VkDevice device,
3286 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003287 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003288 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3289 deviceObject := GetDevice(device)
3290 imageObject := GetImage(image)
3291 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003292}
3293
Jesse Hall606a54e2015-11-19 22:17:28 -08003294cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003295 VkPhysicalDevice physicalDevice,
3296 VkFormat format,
3297 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003298 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003299 VkImageUsageFlags usage,
3300 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003301 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003302 VkSparseImageFormatProperties* pProperties) {
3303 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003304}
3305
Jesse Halla6429252015-11-29 18:59:42 -08003306cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003307 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003308 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003309 const VkBindSparseInfo* pBindInfo,
3310 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003311 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003312
3313 return ?
3314}
3315
3316
3317// Fence functions
3318
3319@threadSafety("system")
3320cmd VkResult vkCreateFence(
3321 VkDevice device,
3322 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003323 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003324 VkFence* pFence) {
3325 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3326 deviceObject := GetDevice(device)
3327
3328 fence := ?
3329 pFence[0] = fence
3330 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003331 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003332
3333 return ?
3334}
3335
3336@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003337cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003338 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003339 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003340 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003341 deviceObject := GetDevice(device)
3342 fenceObject := GetFence(fence)
3343 assert(fenceObject.device == device)
3344
3345 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003346}
3347
3348@threadSafety("system")
3349cmd VkResult vkResetFences(
3350 VkDevice device,
3351 u32 fenceCount,
3352 const VkFence* pFences) {
3353 deviceObject := GetDevice(device)
3354
3355 fences := pFences[0:fenceCount]
3356 for i in (0 .. fenceCount) {
3357 fence := fences[i]
3358 fenceObject := GetFence(fence)
3359 assert(fenceObject.device == device)
3360 fenceObject.signaled = false
3361 }
3362
3363 return ?
3364}
3365
3366@threadSafety("system")
3367cmd VkResult vkGetFenceStatus(
3368 VkDevice device,
3369 VkFence fence) {
3370 deviceObject := GetDevice(device)
3371 fenceObject := GetFence(fence)
3372 assert(fenceObject.device == device)
3373
3374 return ?
3375}
3376
3377@threadSafety("system")
3378cmd VkResult vkWaitForFences(
3379 VkDevice device,
3380 u32 fenceCount,
3381 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003382 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003383 u64 timeout) { /// timeout in nanoseconds
3384 deviceObject := GetDevice(device)
3385
3386 fences := pFences[0:fenceCount]
3387 for i in (0 .. fenceCount) {
3388 fence := fences[i]
3389 fenceObject := GetFence(fence)
3390 assert(fenceObject.device == device)
3391 }
3392
3393 return ?
3394}
3395
3396
3397// Queue semaphore functions
3398
3399@threadSafety("system")
3400cmd VkResult vkCreateSemaphore(
3401 VkDevice device,
3402 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003403 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003404 VkSemaphore* pSemaphore) {
3405 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3406 deviceObject := GetDevice(device)
3407
3408 semaphore := ?
3409 pSemaphore[0] = semaphore
3410 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3411
3412 return ?
3413}
3414
3415@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003416cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003417 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003418 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003419 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003420 deviceObject := GetDevice(device)
3421 semaphoreObject := GetSemaphore(semaphore)
3422 assert(semaphoreObject.device == device)
3423
3424 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003425}
3426
Jesse Halld27f6aa2015-08-15 17:58:48 -07003427
3428// Event functions
3429
3430@threadSafety("system")
3431cmd VkResult vkCreateEvent(
3432 VkDevice device,
3433 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003434 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003435 VkEvent* pEvent) {
3436 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3437 deviceObject := GetDevice(device)
3438
3439 event := ?
3440 pEvent[0] = event
3441 State.Events[event] = new!EventObject(device: device)
3442
3443 return ?
3444}
3445
3446@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003447cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003448 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003449 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003450 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003451 deviceObject := GetDevice(device)
3452 eventObject := GetEvent(event)
3453 assert(eventObject.device == device)
3454
3455 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003456}
3457
3458@threadSafety("system")
3459cmd VkResult vkGetEventStatus(
3460 VkDevice device,
3461 VkEvent event) {
3462 deviceObject := GetDevice(device)
3463 eventObject := GetEvent(event)
3464 assert(eventObject.device == device)
3465
3466 return ?
3467}
3468
3469@threadSafety("system")
3470cmd VkResult vkSetEvent(
3471 VkDevice device,
3472 VkEvent event) {
3473 deviceObject := GetDevice(device)
3474 eventObject := GetEvent(event)
3475 assert(eventObject.device == device)
3476
3477 return ?
3478}
3479
3480@threadSafety("system")
3481cmd VkResult vkResetEvent(
3482 VkDevice device,
3483 VkEvent event) {
3484 deviceObject := GetDevice(device)
3485 eventObject := GetEvent(event)
3486 assert(eventObject.device == device)
3487
3488 return ?
3489}
3490
3491
3492// Query functions
3493
3494@threadSafety("system")
3495cmd VkResult vkCreateQueryPool(
3496 VkDevice device,
3497 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003498 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003499 VkQueryPool* pQueryPool) {
3500 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3501 deviceObject := GetDevice(device)
3502
3503 queryPool := ?
3504 pQueryPool[0] = queryPool
3505 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3506
3507 return ?
3508}
3509
3510@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003511cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003512 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003513 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003514 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003515 deviceObject := GetDevice(device)
3516 queryPoolObject := GetQueryPool(queryPool)
3517 assert(queryPoolObject.device == device)
3518
3519 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003520}
3521
3522@threadSafety("system")
3523cmd VkResult vkGetQueryPoolResults(
3524 VkDevice device,
3525 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003526 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003527 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003528 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003529 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003530 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003531 VkQueryResultFlags flags) {
3532 deviceObject := GetDevice(device)
3533 queryPoolObject := GetQueryPool(queryPool)
3534 assert(queryPoolObject.device == device)
3535
Jesse Halld27f6aa2015-08-15 17:58:48 -07003536 data := pData[0:dataSize]
3537
3538 return ?
3539}
3540
3541// Buffer functions
3542
3543@threadSafety("system")
3544cmd VkResult vkCreateBuffer(
3545 VkDevice device,
3546 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003547 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003548 VkBuffer* pBuffer) {
3549 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3550 deviceObject := GetDevice(device)
3551
3552 buffer := ?
3553 pBuffer[0] = buffer
3554 State.Buffers[buffer] = new!BufferObject(device: device)
3555
3556 return ?
3557}
3558
3559@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003560cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003561 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003562 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003563 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003564 deviceObject := GetDevice(device)
3565 bufferObject := GetBuffer(buffer)
3566 assert(bufferObject.device == device)
3567
Jesse Hall3fbc8562015-11-29 22:10:52 -08003568 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003569 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003570}
3571
3572
3573// Buffer view functions
3574
3575@threadSafety("system")
3576cmd VkResult vkCreateBufferView(
3577 VkDevice device,
3578 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003579 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003580 VkBufferView* pView) {
3581 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3582 deviceObject := GetDevice(device)
3583
3584 bufferObject := GetBuffer(pCreateInfo.buffer)
3585 assert(bufferObject.device == device)
3586
3587 view := ?
3588 pView[0] = view
3589 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3590
3591 return ?
3592}
3593
3594@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003595cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003596 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003597 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003598 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003599 deviceObject := GetDevice(device)
3600 bufferViewObject := GetBufferView(bufferView)
3601 assert(bufferViewObject.device == device)
3602
3603 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003604}
3605
3606
3607// Image functions
3608
3609@threadSafety("system")
3610cmd VkResult vkCreateImage(
3611 VkDevice device,
3612 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003613 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003614 VkImage* pImage) {
3615 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3616 deviceObject := GetDevice(device)
3617
3618 image := ?
3619 pImage[0] = image
3620 State.Images[image] = new!ImageObject(device: device)
3621
3622 return ?
3623}
3624
3625@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003626cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003627 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003628 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003629 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003630 deviceObject := GetDevice(device)
3631 imageObject := GetImage(image)
3632 assert(imageObject.device == device)
3633
Jesse Hall3fbc8562015-11-29 22:10:52 -08003634 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003635 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003636}
3637
Jesse Hall606a54e2015-11-19 22:17:28 -08003638cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003639 VkDevice device,
3640 VkImage image,
3641 const VkImageSubresource* pSubresource,
3642 VkSubresourceLayout* pLayout) {
3643 deviceObject := GetDevice(device)
3644 imageObject := GetImage(image)
3645 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003646}
3647
3648
3649// Image view functions
3650
3651@threadSafety("system")
3652cmd VkResult vkCreateImageView(
3653 VkDevice device,
3654 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003655 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003656 VkImageView* pView) {
3657 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
3658 deviceObject := GetDevice(device)
3659
3660 imageObject := GetImage(pCreateInfo.image)
3661 assert(imageObject.device == device)
3662
3663 view := ?
3664 pView[0] = view
3665 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
3666
3667 return ?
3668}
3669
3670@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003671cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003672 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003673 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003674 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003675 deviceObject := GetDevice(device)
3676 imageViewObject := GetImageView(imageView)
3677 assert(imageViewObject.device == device)
3678
3679 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003680}
3681
3682
3683// Shader functions
3684
3685cmd VkResult vkCreateShaderModule(
3686 VkDevice device,
3687 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003688 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003689 VkShaderModule* pShaderModule) {
3690 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
3691 deviceObject := GetDevice(device)
3692
3693 shaderModule := ?
3694 pShaderModule[0] = shaderModule
3695 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
3696
3697 return ?
3698}
3699
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003700cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003701 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003702 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003703 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003704 deviceObject := GetDevice(device)
3705 shaderModuleObject := GetShaderModule(shaderModule)
3706 assert(shaderModuleObject.device == device)
3707
3708 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003709}
3710
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711
3712// Pipeline functions
3713
3714cmd VkResult vkCreatePipelineCache(
3715 VkDevice device,
3716 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003717 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003718 VkPipelineCache* pPipelineCache) {
3719 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
3720 deviceObject := GetDevice(device)
3721
3722 pipelineCache := ?
3723 pPipelineCache[0] = pipelineCache
3724 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
3725
3726 return ?
3727}
3728
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003729cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003730 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003731 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003732 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003733 deviceObject := GetDevice(device)
3734 pipelineCacheObject := GetPipelineCache(pipelineCache)
3735 assert(pipelineCacheObject.device == device)
3736
3737 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003738}
3739
Jesse Halld27f6aa2015-08-15 17:58:48 -07003740cmd VkResult vkGetPipelineCacheData(
3741 VkDevice device,
3742 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003743 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003744 void* pData) {
3745 deviceObject := GetDevice(device)
3746 pipelineCacheObject := GetPipelineCache(pipelineCache)
3747 assert(pipelineCacheObject.device == device)
3748
3749 return ?
3750}
3751
3752cmd VkResult vkMergePipelineCaches(
3753 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003754 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003755 u32 srcCacheCount,
3756 const VkPipelineCache* pSrcCaches) {
3757 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003758 dstCacheObject := GetPipelineCache(dstCache)
3759 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003760
3761 srcCaches := pSrcCaches[0:srcCacheCount]
3762 for i in (0 .. srcCacheCount) {
3763 srcCache := srcCaches[i]
3764 srcCacheObject := GetPipelineCache(srcCache)
3765 assert(srcCacheObject.device == device)
3766 }
3767
3768 return ?
3769}
3770
3771cmd VkResult vkCreateGraphicsPipelines(
3772 VkDevice device,
3773 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003774 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003775 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003776 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003777 VkPipeline* pPipelines) {
3778 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003779 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780 pipelineCacheObject := GetPipelineCache(pipelineCache)
3781 assert(pipelineCacheObject.device == device)
3782 }
3783
Jesse Hall03b6fe12015-11-24 12:44:21 -08003784 createInfos := pCreateInfos[0:createInfoCount]
3785 pipelines := pPipelines[0:createInfoCount]
3786 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003787 pipeline := ?
3788 pipelines[i] = pipeline
3789 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3790 }
3791
3792 return ?
3793}
3794
3795cmd VkResult vkCreateComputePipelines(
3796 VkDevice device,
3797 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003798 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003799 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003800 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003801 VkPipeline* pPipelines) {
3802 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003803 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003804 pipelineCacheObject := GetPipelineCache(pipelineCache)
3805 assert(pipelineCacheObject.device == device)
3806 }
3807
Jesse Hall03b6fe12015-11-24 12:44:21 -08003808 createInfos := pCreateInfos[0:createInfoCount]
3809 pipelines := pPipelines[0:createInfoCount]
3810 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003811 pipeline := ?
3812 pipelines[i] = pipeline
3813 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3814 }
3815
3816 return ?
3817}
3818
3819@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003820cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003821 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003822 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003823 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003824 deviceObject := GetDevice(device)
3825 pipelineObjects := GetPipeline(pipeline)
3826 assert(pipelineObjects.device == device)
3827
3828 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003829}
3830
3831
3832// Pipeline layout functions
3833
3834@threadSafety("system")
3835cmd VkResult vkCreatePipelineLayout(
3836 VkDevice device,
3837 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003838 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003839 VkPipelineLayout* pPipelineLayout) {
3840 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
3841 deviceObject := GetDevice(device)
3842
3843 pipelineLayout := ?
3844 pPipelineLayout[0] = pipelineLayout
3845 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
3846
3847 return ?
3848}
3849
3850@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003851cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003852 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003853 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003854 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003855 deviceObject := GetDevice(device)
3856 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
3857 assert(pipelineLayoutObjects.device == device)
3858
3859 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003860}
3861
3862
3863// Sampler functions
3864
3865@threadSafety("system")
3866cmd VkResult vkCreateSampler(
3867 VkDevice device,
3868 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003869 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003870 VkSampler* pSampler) {
3871 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
3872 deviceObject := GetDevice(device)
3873
3874 sampler := ?
3875 pSampler[0] = sampler
3876 State.Samplers[sampler] = new!SamplerObject(device: device)
3877
3878 return ?
3879}
3880
3881@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003882cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003883 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003884 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003885 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003886 deviceObject := GetDevice(device)
3887 samplerObject := GetSampler(sampler)
3888 assert(samplerObject.device == device)
3889
3890 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003891}
3892
3893
3894// Descriptor set functions
3895
3896@threadSafety("system")
3897cmd VkResult vkCreateDescriptorSetLayout(
3898 VkDevice device,
3899 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003900 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003901 VkDescriptorSetLayout* pSetLayout) {
3902 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
3903 deviceObject := GetDevice(device)
3904
3905 setLayout := ?
3906 pSetLayout[0] = setLayout
3907 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
3908
3909 return ?
3910}
3911
3912@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003913cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003914 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003915 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003916 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003917 deviceObject := GetDevice(device)
3918 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
3919 assert(descriptorSetLayoutObject.device == device)
3920
3921 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003922}
3923
3924@threadSafety("system")
3925cmd VkResult vkCreateDescriptorPool(
3926 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003927 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003928 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003929 VkDescriptorPool* pDescriptorPool) {
3930 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
3931 deviceObject := GetDevice(device)
3932
3933 descriptorPool := ?
3934 pDescriptorPool[0] = descriptorPool
3935 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
3936
3937 return ?
3938}
3939
3940@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003941cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003942 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003943 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003944 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003945 deviceObject := GetDevice(device)
3946 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3947 assert(descriptorPoolObject.device == device)
3948
3949 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003950}
3951
3952@threadSafety("app")
3953cmd VkResult vkResetDescriptorPool(
3954 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08003955 VkDescriptorPool descriptorPool,
3956 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003957 deviceObject := GetDevice(device)
3958 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3959 assert(descriptorPoolObject.device == device)
3960
3961 return ?
3962}
3963
3964@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003965cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003966 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003967 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003968 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003969 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003970 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003971 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003972
Jesse Hall03b6fe12015-11-24 12:44:21 -08003973 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
3974 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003975 setLayout := setLayouts[i]
3976 setLayoutObject := GetDescriptorSetLayout(setLayout)
3977 assert(setLayoutObject.device == device)
3978 }
3979
Jesse Hall03b6fe12015-11-24 12:44:21 -08003980 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
3981 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003982 descriptorSet := ?
3983 descriptorSets[i] = descriptorSet
3984 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
3985 }
3986
3987 return ?
3988}
3989
Jesse Hallf09c6b12015-08-15 19:54:28 -07003990cmd VkResult vkFreeDescriptorSets(
3991 VkDevice device,
3992 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003993 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07003994 const VkDescriptorSet* pDescriptorSets) {
3995 deviceObject := GetDevice(device)
3996 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3997
Jesse Hall03b6fe12015-11-24 12:44:21 -08003998 descriptorSets := pDescriptorSets[0:descriptorSetCount]
3999 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004000 descriptorSet := descriptorSets[i]
4001 descriptorSetObject := GetDescriptorSet(descriptorSet)
4002 assert(descriptorSetObject.device == device)
4003 State.DescriptorSets[descriptorSet] = null
4004 }
4005
4006 return ?
4007}
4008
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004009cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004010 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004011 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004012 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004013 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004014 const VkCopyDescriptorSet* pDescriptorCopies) {
4015 deviceObject := GetDevice(device)
4016
Jesse Hallb00daad2015-11-29 19:46:20 -08004017 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4018 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004019 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004020 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004021 assert(descriptorWriteObject.device == device)
4022 }
4023
Jesse Hallb00daad2015-11-29 19:46:20 -08004024 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4025 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004026 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004027 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004028 assert(descriptorCopyObject.device == device)
4029 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004030}
4031
4032
4033// Framebuffer functions
4034
4035@threadSafety("system")
4036cmd VkResult vkCreateFramebuffer(
4037 VkDevice device,
4038 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004039 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004040 VkFramebuffer* pFramebuffer) {
4041 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4042 deviceObject := GetDevice(device)
4043
4044 framebuffer := ?
4045 pFramebuffer[0] = framebuffer
4046 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4047
4048 return ?
4049}
4050
4051@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004052cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004053 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004054 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004055 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004056 deviceObject := GetDevice(device)
4057 framebufferObject := GetFramebuffer(framebuffer)
4058 assert(framebufferObject.device == device)
4059
4060 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004061}
4062
4063
4064// Renderpass functions
4065
4066@threadSafety("system")
4067cmd VkResult vkCreateRenderPass(
4068 VkDevice device,
4069 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004070 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004071 VkRenderPass* pRenderPass) {
4072 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4073 deviceObject := GetDevice(device)
4074
4075 renderpass := ?
4076 pRenderPass[0] = renderpass
4077 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4078
4079 return ?
4080}
4081
4082@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004083cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004084 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004085 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004086 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004087 deviceObject := GetDevice(device)
4088 renderPassObject := GetRenderPass(renderPass)
4089 assert(renderPassObject.device == device)
4090
4091 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004092}
4093
Jesse Hall606a54e2015-11-19 22:17:28 -08004094cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004095 VkDevice device,
4096 VkRenderPass renderPass,
4097 VkExtent2D* pGranularity) {
4098 deviceObject := GetDevice(device)
4099 renderPassObject := GetRenderPass(renderPass)
4100
4101 granularity := ?
4102 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004103}
4104
4105// Command pool functions
4106
4107cmd VkResult vkCreateCommandPool(
4108 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004109 const VkCommandPoolCreateInfo* pCreateInfo,
4110 const VkAllocationCallbacks* pAllocator,
4111 VkCommandPool* pCommandPool) {
4112 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004113 deviceObject := GetDevice(device)
4114
Jesse Hall3fbc8562015-11-29 22:10:52 -08004115 commandPool := ?
4116 pCommandPool[0] = commandPool
4117 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004118
4119 return ?
4120}
4121
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004122cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004123 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004124 VkCommandPool commandPool,
4125 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004126 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004127 commandPoolObject := GetCommandPool(commandPool)
4128 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004129
Jesse Hall3fbc8562015-11-29 22:10:52 -08004130 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004131}
4132
4133cmd VkResult vkResetCommandPool(
4134 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004135 VkCommandPool commandPool,
4136 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004137 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004138 commandPoolObject := GetCommandPool(commandPool)
4139 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004140
4141 return ?
4142}
4143
4144// Command buffer functions
4145
Jesse Hall3fbc8562015-11-29 22:10:52 -08004146macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4147 memoryObject := GetDeviceMemory(memory)
4148 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004149
Jesse Hall3fbc8562015-11-29 22:10:52 -08004150 commandBufferObject := GetCommandBuffer(commandBuffer)
4151 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004152}
4153
Jesse Hall3fbc8562015-11-29 22:10:52 -08004154macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4155 memoryObject := GetDeviceMemory(memory)
4156 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004157
Jesse Hall3fbc8562015-11-29 22:10:52 -08004158 commandBufferObject := GetCommandBuffer(commandBuffer)
4159 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004160}
4161
4162@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004163cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004164 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004165 const VkCommandBufferAllocateInfo* pAllocateInfo,
4166 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004167 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004168
Jesse Hall3dd678a2016-01-08 21:52:01 -08004169 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004170 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004171 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004172 commandBuffer := ?
4173 commandBuffers[i] = commandBuffer
4174 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004175 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004176
4177 return ?
4178}
4179
4180@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004181cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004182 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004183 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004184 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004185 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004186 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004187
Jesse Hall3fbc8562015-11-29 22:10:52 -08004188 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004189 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004190 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4191 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004192 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004193 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004194 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004195}
4196
4197@threadSafety("app")
4198cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004199 VkCommandBuffer commandBuffer,
4200 const VkCommandBufferBeginInfo* pBeginInfo) {
4201 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4202 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004203
4204 // TODO: iterate over boundObjects and clear memory bindings
4205
4206 return ?
4207}
4208
4209@threadSafety("app")
4210cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004211 VkCommandBuffer commandBuffer) {
4212 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004213
4214 return ?
4215}
4216
4217@threadSafety("app")
4218cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004219 VkCommandBuffer commandBuffer,
4220 VkCommandBufferResetFlags flags) {
4221 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004222
4223 // TODO: iterate over boundObjects and clear memory bindings
4224
4225 return ?
4226}
4227
4228
4229// Command buffer building functions
4230
4231@threadSafety("app")
4232cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004233 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004234 VkPipelineBindPoint pipelineBindPoint,
4235 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004236 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004237 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004238 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004239
Jesse Halld8bade02015-11-24 10:24:18 -08004240 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004241 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4242 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4243 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004244 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004245}
4246
4247@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004248cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004249 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004250 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004251 u32 viewportCount,
4252 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004253 commandBufferObject := GetCommandBuffer(commandBuffer)
4254 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004255}
4256
4257@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004258cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004259 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004260 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004261 u32 scissorCount,
4262 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004263 commandBufferObject := GetCommandBuffer(commandBuffer)
4264 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004265}
4266
4267@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004268cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004269 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004270 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004271 commandBufferObject := GetCommandBuffer(commandBuffer)
4272 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004273}
4274
4275@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004276cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004277 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004278 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004279 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004280 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004281 commandBufferObject := GetCommandBuffer(commandBuffer)
4282 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004283}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004284
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004285@threadSafety("app")
4286cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004287 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004288 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4289 // an annotation as a quick hack to pass this to the template without
4290 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004291 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004292 commandBufferObject := GetCommandBuffer(commandBuffer)
4293 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004294}
4295
4296@threadSafety("app")
4297cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004298 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004299 f32 minDepthBounds,
4300 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004301 commandBufferObject := GetCommandBuffer(commandBuffer)
4302 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004303}
4304
4305@threadSafety("app")
4306cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004307 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004308 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004309 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004310 commandBufferObject := GetCommandBuffer(commandBuffer)
4311 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004312}
4313
4314@threadSafety("app")
4315cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004316 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004317 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004318 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004319 commandBufferObject := GetCommandBuffer(commandBuffer)
4320 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004321}
4322
4323@threadSafety("app")
4324cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004325 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004326 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004327 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004328 commandBufferObject := GetCommandBuffer(commandBuffer)
4329 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004330}
4331
4332@threadSafety("app")
4333cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004334 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004335 VkPipelineBindPoint pipelineBindPoint,
4336 VkPipelineLayout layout,
4337 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004338 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004339 const VkDescriptorSet* pDescriptorSets,
4340 u32 dynamicOffsetCount,
4341 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004342 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004343
Jesse Hall03b6fe12015-11-24 12:44:21 -08004344 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4345 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004346 descriptorSet := descriptorSets[i]
4347 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004348 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004349 }
4350
4351 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4352 for i in (0 .. dynamicOffsetCount) {
4353 dynamicOffset := dynamicOffsets[i]
4354 }
4355
Jesse Halld8bade02015-11-24 10:24:18 -08004356 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004357 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4358 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4359 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004360 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004361}
4362
4363@threadSafety("app")
4364cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004365 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004366 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004367 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004368 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004369 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004370 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004371 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004372
Jesse Hall3fbc8562015-11-29 22:10:52 -08004373 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004374
Jesse Hall3fbc8562015-11-29 22:10:52 -08004375 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004376}
4377
4378@threadSafety("app")
4379cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004380 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004381 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004382 u32 bindingCount,
4383 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004384 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004385 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004386
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004387 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004388 buffers := pBuffers[0:bindingCount]
4389 offsets := pOffsets[0:bindingCount]
4390 for i in (0 .. bindingCount) {
4391 buffer := buffers[i]
4392 offset := offsets[i]
4393 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004394 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004395
Jesse Hall3fbc8562015-11-29 22:10:52 -08004396 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004397 }
4398
Jesse Hall3fbc8562015-11-29 22:10:52 -08004399 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004400}
4401
4402@threadSafety("app")
4403cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004404 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004405 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004406 u32 instanceCount,
4407 u32 firstVertex,
4408 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004409 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004410
Jesse Hall3fbc8562015-11-29 22:10:52 -08004411 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004412}
4413
4414@threadSafety("app")
4415cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004416 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004417 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004418 u32 instanceCount,
4419 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004420 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004421 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004422 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004423
Jesse Hall3fbc8562015-11-29 22:10:52 -08004424 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004425}
4426
4427@threadSafety("app")
4428cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004429 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004430 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004431 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004432 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004433 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004434 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004435 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004436 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004437
Jesse Hall3fbc8562015-11-29 22:10:52 -08004438 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004439
Jesse Hall3fbc8562015-11-29 22:10:52 -08004440 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004441}
4442
4443@threadSafety("app")
4444cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004445 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004446 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004447 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004448 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004449 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004450 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004451 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004452 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004453
Jesse Hall3fbc8562015-11-29 22:10:52 -08004454 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004455
Jesse Hall3fbc8562015-11-29 22:10:52 -08004456 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004457}
4458
4459@threadSafety("app")
4460cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004461 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004462 u32 x,
4463 u32 y,
4464 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004465 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004466
Jesse Hall3fbc8562015-11-29 22:10:52 -08004467 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004468}
4469
4470@threadSafety("app")
4471cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004472 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004473 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004474 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004475 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004476 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004477 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004478
Jesse Hall3fbc8562015-11-29 22:10:52 -08004479 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004480
Jesse Hall3fbc8562015-11-29 22:10:52 -08004481 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004482}
4483
4484@threadSafety("app")
4485cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004486 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004487 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004488 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004489 u32 regionCount,
4490 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004491 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004492 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004493 dstBufferObject := GetBuffer(dstBuffer)
4494 assert(commandBufferObject.device == srcBufferObject.device)
4495 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004496
4497 regions := pRegions[0:regionCount]
4498 for i in (0 .. regionCount) {
4499 region := regions[i]
4500 }
4501
Jesse Hall3fbc8562015-11-29 22:10:52 -08004502 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4503 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004504
Jesse Hall65ab5522015-11-30 00:07:16 -08004505 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004506}
4507
4508@threadSafety("app")
4509cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004510 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004511 VkImage srcImage,
4512 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004513 VkImage dstImage,
4514 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004515 u32 regionCount,
4516 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004517 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004518 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004519 dstImageObject := GetImage(dstImage)
4520 assert(commandBufferObject.device == srcImageObject.device)
4521 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004522
4523 regions := pRegions[0:regionCount]
4524 for i in (0 .. regionCount) {
4525 region := regions[i]
4526 }
4527
Jesse Hall3fbc8562015-11-29 22:10:52 -08004528 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4529 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004530
Jesse Hall65ab5522015-11-30 00:07:16 -08004531 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004532}
4533
4534@threadSafety("app")
4535cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004536 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004537 VkImage srcImage,
4538 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004539 VkImage dstImage,
4540 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004541 u32 regionCount,
4542 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004543 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004544 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004545 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004546 dstImageObject := GetImage(dstImage)
4547 assert(commandBufferObject.device == srcImageObject.device)
4548 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004549
4550 regions := pRegions[0:regionCount]
4551 for i in (0 .. regionCount) {
4552 region := regions[i]
4553 }
4554
Jesse Hall3fbc8562015-11-29 22:10:52 -08004555 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4556 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004557
Jesse Hall3fbc8562015-11-29 22:10:52 -08004558 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004559}
4560
4561@threadSafety("app")
4562cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004563 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004564 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004565 VkImage dstImage,
4566 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004567 u32 regionCount,
4568 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004569 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004570 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004571 dstImageObject := GetImage(dstImage)
4572 assert(commandBufferObject.device == srcBufferObject.device)
4573 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004574
4575 regions := pRegions[0:regionCount]
4576 for i in (0 .. regionCount) {
4577 region := regions[i]
4578 }
4579
Jesse Hall3fbc8562015-11-29 22:10:52 -08004580 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4581 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004582
Jesse Hall65ab5522015-11-30 00:07:16 -08004583 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004584}
4585
4586@threadSafety("app")
4587cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004588 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004589 VkImage srcImage,
4590 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004591 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004592 u32 regionCount,
4593 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004594 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004595 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004596 dstBufferObject := GetBuffer(dstBuffer)
4597 assert(commandBufferObject.device == srcImageObject.device)
4598 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004599
4600 regions := pRegions[0:regionCount]
4601 for i in (0 .. regionCount) {
4602 region := regions[i]
4603 }
4604
Jesse Hall3fbc8562015-11-29 22:10:52 -08004605 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4606 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004607
Jesse Hall65ab5522015-11-30 00:07:16 -08004608 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004609}
4610
4611@threadSafety("app")
4612cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004613 VkCommandBuffer commandBuffer,
4614 VkBuffer dstBuffer,
4615 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004616 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07004617 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004618 commandBufferObject := GetCommandBuffer(commandBuffer)
4619 dstBufferObject := GetBuffer(dstBuffer)
4620 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004621
4622 data := pData[0:dataSize]
4623
Jesse Hall3fbc8562015-11-29 22:10:52 -08004624 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004625
Jesse Hall65ab5522015-11-30 00:07:16 -08004626 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004627}
4628
4629@threadSafety("app")
4630cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004631 VkCommandBuffer commandBuffer,
4632 VkBuffer dstBuffer,
4633 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004634 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004635 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004636 commandBufferObject := GetCommandBuffer(commandBuffer)
4637 dstBufferObject := GetBuffer(dstBuffer)
4638 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004639
Jesse Hall65ab5522015-11-30 00:07:16 -08004640 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004641}
4642
4643@threadSafety("app")
4644cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004645 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004646 VkImage image,
4647 VkImageLayout imageLayout,
4648 const VkClearColorValue* pColor,
4649 u32 rangeCount,
4650 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004651 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004652 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004653 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004654
4655 ranges := pRanges[0:rangeCount]
4656 for i in (0 .. rangeCount) {
4657 range := ranges[i]
4658 }
4659
Jesse Hall3fbc8562015-11-29 22:10:52 -08004660 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004661
Jesse Hall3fbc8562015-11-29 22:10:52 -08004662 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004663}
4664
4665@threadSafety("app")
4666cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004667 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004668 VkImage image,
4669 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004670 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004671 u32 rangeCount,
4672 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004673 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004674 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004675 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004676
4677 ranges := pRanges[0:rangeCount]
4678 for i in (0 .. rangeCount) {
4679 range := ranges[i]
4680 }
4681
Jesse Hall3fbc8562015-11-29 22:10:52 -08004682 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004683
Jesse Hall3fbc8562015-11-29 22:10:52 -08004684 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004685}
4686
4687@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08004688cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004689 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08004690 u32 attachmentCount,
4691 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004692 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08004693 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004694 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004695
4696 rects := pRects[0:rectCount]
4697 for i in (0 .. rectCount) {
4698 rect := rects[i]
4699 }
4700
Jesse Hall3fbc8562015-11-29 22:10:52 -08004701 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004702}
4703
4704@threadSafety("app")
4705cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004706 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004707 VkImage srcImage,
4708 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004709 VkImage dstImage,
4710 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004711 u32 regionCount,
4712 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004713 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004714 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004715 dstImageObject := GetImage(dstImage)
4716 assert(commandBufferObject.device == srcImageObject.device)
4717 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004718
4719 regions := pRegions[0:regionCount]
4720 for i in (0 .. regionCount) {
4721 region := regions[i]
4722 }
4723
Jesse Hall3fbc8562015-11-29 22:10:52 -08004724 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4725 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004726
Jesse Hall3fbc8562015-11-29 22:10:52 -08004727 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004728}
4729
4730@threadSafety("app")
4731cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004732 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004733 VkEvent event,
4734 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004735 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004736 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004737 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004738}
4739
4740@threadSafety("app")
4741cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004742 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004743 VkEvent event,
4744 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004745 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004746 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004747 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004748}
4749
4750@threadSafety("app")
4751cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004752 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004753 u32 eventCount,
4754 const VkEvent* pEvents,
4755 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004756 VkPipelineStageFlags dstStageMask,
4757 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004758 const VkMemoryBarrier* pMemoryBarriers,
4759 u32 bufferMemoryBarrierCount,
4760 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4761 u32 imageMemoryBarrierCount,
4762 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004763 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004764
4765 events := pEvents[0:eventCount]
4766 for i in (0 .. eventCount) {
4767 event := events[i]
4768 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004769 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004770 }
4771
Jesse Hall3dd678a2016-01-08 21:52:01 -08004772 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004773 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004774 memoryBarrier := memoryBarriers[i]
4775 }
4776 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4777 for i in (0 .. bufferMemoryBarrierCount) {
4778 bufferMemoryBarrier := bufferMemoryBarriers[i]
4779 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4780 assert(bufferObject.device == commandBufferObject.device)
4781 }
4782 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4783 for i in (0 .. imageMemoryBarrierCount) {
4784 imageMemoryBarrier := imageMemoryBarriers[i]
4785 imageObject := GetImage(imageMemoryBarrier.image)
4786 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004787 }
4788}
4789
4790@threadSafety("app")
4791cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004792 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004793 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004794 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08004795 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004796 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004797 const VkMemoryBarrier* pMemoryBarriers,
4798 u32 bufferMemoryBarrierCount,
4799 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4800 u32 imageMemoryBarrierCount,
4801 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004802 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004803
Jesse Hall3dd678a2016-01-08 21:52:01 -08004804 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004805 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004806 memoryBarrier := memoryBarriers[i]
4807 }
4808 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4809 for i in (0 .. bufferMemoryBarrierCount) {
4810 bufferMemoryBarrier := bufferMemoryBarriers[i]
4811 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4812 assert(bufferObject.device == commandBufferObject.device)
4813 }
4814 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4815 for i in (0 .. imageMemoryBarrierCount) {
4816 imageMemoryBarrier := imageMemoryBarriers[i]
4817 imageObject := GetImage(imageMemoryBarrier.image)
4818 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004819 }
4820}
4821
4822@threadSafety("app")
4823cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004824 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004825 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004826 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004827 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004828 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004829 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004830 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004831}
4832
4833@threadSafety("app")
4834cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004835 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004836 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004837 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004838 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004839 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004840 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004841}
4842
4843@threadSafety("app")
4844cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004845 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004846 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004847 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004848 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004849 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004850 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004851 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004852}
4853
4854@threadSafety("app")
4855cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004856 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08004857 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004858 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004859 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004860 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004861 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004862 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004863}
4864
4865@threadSafety("app")
4866cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004867 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004868 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004869 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004870 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004871 VkBuffer dstBuffer,
4872 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004873 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004874 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004875 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004876 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004877 dstBufferObject := GetBuffer(dstBuffer)
4878 assert(commandBufferObject.device == queryPoolObject.device)
4879 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004880}
4881
4882cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004883 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004884 VkPipelineLayout layout,
4885 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004886 u32 offset,
4887 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004888 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004889 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004890 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004891 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004892}
4893
4894@threadSafety("app")
4895cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004896 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004897 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08004898 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004899 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004900 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
4901 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004902 assert(commandBufferObject.device == renderPassObject.device)
4903 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004904
Jesse Hall3fbc8562015-11-29 22:10:52 -08004905 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004906}
4907
4908cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004909 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08004910 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004911 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004912}
4913
4914@threadSafety("app")
4915cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004916 VkCommandBuffer commandBuffer) {
4917 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004918
Jesse Hall3fbc8562015-11-29 22:10:52 -08004919 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004920}
4921
4922cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004923 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004924 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004925 const VkCommandBuffer* pCommandBuffers) {
4926 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004927
Jesse Hall3dd678a2016-01-08 21:52:01 -08004928 commandBuffers := pCommandBuffers[0:commandBufferCount]
4929 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004930 secondaryCommandBuffer := commandBuffers[i]
4931 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
4932 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004933 }
4934}
4935
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004936@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004937cmd void vkDestroySurfaceKHR(
4938 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08004939 VkSurfaceKHR surface,
4940 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004941 instanceObject := GetInstance(instance)
4942 surfaceObject := GetSurface(surface)
4943 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08004944
Jesse Hall1356b0d2015-11-23 17:24:58 -08004945 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08004946}
4947
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004948@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004949cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004950 VkPhysicalDevice physicalDevice,
4951 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004952 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08004953 VkBool32* pSupported) {
4954 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004955
4956 return ?
4957}
4958
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004959@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004960cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
4961 VkPhysicalDevice physicalDevice,
4962 VkSurfaceKHR surface,
4963 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
4964 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4965
4966 surfaceCapabilities := ?
4967 pSurfaceCapabilities[0] = surfaceCapabilities
4968
4969 return ?
4970}
4971
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004972@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004973cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
4974 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004975 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004976 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004977 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004978 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004979
4980 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004981 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004982 surfaceFormats := pSurfaceFormats[0:count]
4983
4984 for i in (0 .. count) {
4985 surfaceFormat := ?
4986 surfaceFormats[i] = surfaceFormat
4987 }
4988
4989 return ?
4990}
4991
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004992@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004993cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
4994 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004995 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004996 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004997 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004998 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004999
5000 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005001 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005002 presentModes := pPresentModes[0:count]
5003
5004 for i in (0 .. count) {
5005 presentMode := ?
5006 presentModes[i] = presentMode
5007 }
5008
5009 return ?
5010}
5011
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005012@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005013cmd VkResult vkCreateSwapchainKHR(
5014 VkDevice device,
5015 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005016 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005017 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005018 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005019 deviceObject := GetDevice(device)
5020
5021 swapchain := ?
5022 pSwapchain[0] = swapchain
5023 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5024
5025 return ?
5026}
5027
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005028@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005029cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005030 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005031 VkSwapchainKHR swapchain,
5032 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005033 deviceObject := GetDevice(device)
5034 swapchainObject := GetSwapchain(swapchain)
5035 assert(swapchainObject.device == device)
5036
5037 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005038}
5039
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005040@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005041cmd VkResult vkGetSwapchainImagesKHR(
5042 VkDevice device,
5043 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005044 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005045 VkImage* pSwapchainImages) {
5046 deviceObject := GetDevice(device)
5047
5048 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005049 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005050 swapchainImages := pSwapchainImages[0:count]
5051
5052 for i in (0 .. count) {
5053 swapchainImage := ?
5054 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005055 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005056 }
5057
5058 return ?
5059}
5060
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005061@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005062cmd VkResult vkAcquireNextImageKHR(
5063 VkDevice device,
5064 VkSwapchainKHR swapchain,
5065 u64 timeout,
5066 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005067 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005068 u32* pImageIndex) {
5069 deviceObject := GetDevice(device)
5070 swapchainObject := GetSwapchain(swapchain)
5071
5072 imageIndex := ?
5073 pImageIndex[0] = imageIndex
5074
5075 return ?
5076}
5077
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005078@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005079cmd VkResult vkQueuePresentKHR(
5080 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005081 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005082 queueObject := GetQueue(queue)
5083
5084 presentInfo := ?
5085 pPresentInfo[0] = presentInfo
5086
5087 return ?
5088}
5089
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005090@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005091cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5092 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005093 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005094 VkDisplayPropertiesKHR* pProperties) {
5095 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5096 return ?
5097}
5098
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005099@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005100cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5101 VkPhysicalDevice physicalDevice,
5102 u32* pPropertyCount,
5103 VkDisplayPlanePropertiesKHR* pProperties) {
5104 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5105 return ?
5106}
5107
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005108@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005109cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5110 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005111 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005112 u32* pDisplayCount,
5113 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005114 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5115 return ?
5116}
5117
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005118@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005119cmd VkResult vkGetDisplayModePropertiesKHR(
5120 VkPhysicalDevice physicalDevice,
5121 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005122 u32* pPropertyCount,
5123 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005124 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5125 return ?
5126}
5127
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005128@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005129cmd VkResult vkCreateDisplayModeKHR(
5130 VkPhysicalDevice physicalDevice,
5131 VkDisplayKHR display,
5132 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005133 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005134 VkDisplayModeKHR* pMode) {
5135 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5136 return ?
5137}
5138
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005139@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005140cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005141 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005142 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005143 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005144 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005145 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5146 return ?
5147}
5148
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005149@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005150cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5151 VkInstance instance,
5152 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005153 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005154 VkSurfaceKHR* pSurface) {
5155 return ?
5156}
5157
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005158@extension("VK_KHR_display_swapchain")
5159cmd VkResult vkCreateSharedSwapchainsKHR(
5160 VkDevice device,
5161 u32 swapchainCount,
5162 const VkSwapchainCreateInfoKHR* pCreateInfos,
5163 const VkAllocationCallbacks* pAllocator,
5164 VkSwapchainKHR* pSwapchains) {
5165 return ?
5166}
5167
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005168@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005169cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005170 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005171 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005172 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005173 VkSurfaceKHR* pSurface) {
5174 instanceObject := GetInstance(instance)
5175 return ?
5176}
5177
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005178@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005179cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5180 VkPhysicalDevice physicalDevice,
5181 u32 queueFamilyIndex,
5182 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005183 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005184 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5185 return ?
5186}
5187
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005188@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005189cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005190 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005191 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005192 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005193 VkSurfaceKHR* pSurface) {
5194 instanceObject := GetInstance(instance)
5195 return ?
5196}
5197
Jesse Hall523db342015-11-30 21:12:55 -08005198@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005199cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5200 VkPhysicalDevice physicalDevice,
5201 u32 queueFamilyIndex,
5202 platform.xcb_connection_t* connection,
5203 platform.xcb_visualid_t visual_id) {
5204 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5205 return ?
5206}
5207
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005208@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005209cmd VkResult vkCreateWaylandSurfaceKHR(
5210 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005211 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005212 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005213 VkSurfaceKHR* pSurface) {
5214 instanceObject := GetInstance(instance)
5215 return ?
5216}
5217
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005218@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005219cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5220 VkPhysicalDevice physicalDevice,
5221 u32 queueFamilyIndex,
5222 platform.wl_display* display) {
5223 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5224 return ?
5225}
5226
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005227@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005228cmd VkResult vkCreateMirSurfaceKHR(
5229 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005230 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005231 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005232 VkSurfaceKHR* pSurface) {
5233 instanceObject := GetInstance(instance)
5234 return ?
5235}
5236
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005237@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005238cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5239 VkPhysicalDevice physicalDevice,
5240 u32 queueFamilyIndex,
5241 platform.MirConnection* connection) {
5242 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5243 return ?
5244}
5245
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005246@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005247cmd VkResult vkCreateAndroidSurfaceKHR(
5248 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005249 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005250 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005251 VkSurfaceKHR* pSurface) {
5252 instanceObject := GetInstance(instance)
5253 return ?
5254}
5255
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005256@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005257cmd VkResult vkCreateWin32SurfaceKHR(
5258 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005259 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005260 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005261 VkSurfaceKHR* pSurface) {
5262 instanceObject := GetInstance(instance)
5263 return ?
5264}
5265
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005266@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005267cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5268 VkPhysicalDevice physicalDevice,
5269 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005270 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005271 return ?
5272}
5273
Chia-I Wub262ddc2016-03-22 07:38:20 +08005274@extension("VK_ANDROID_native_buffer")
5275cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5276 VkDevice device,
5277 VkFormat format,
5278 VkImageUsageFlags imageUsage,
5279 int* grallocUsage) {
5280 return ?
5281}
5282
5283@extension("VK_ANDROID_native_buffer")
5284cmd VkResult vkAcquireImageANDROID(
5285 VkDevice device,
5286 VkImage image,
5287 int nativeFenceFd,
5288 VkSemaphore semaphore,
5289 VkFence fence) {
5290 return ?
5291}
5292
5293@extension("VK_ANDROID_native_buffer")
5294cmd VkResult vkQueueSignalReleaseImageANDROID(
5295 VkQueue queue,
5296 u32 waitSemaphoreCount,
5297 const VkSemaphore* pWaitSemaphores,
5298 VkImage image,
5299 int* pNativeFenceFd) {
5300 return ?
5301}
5302
Jesse Hall715b86a2016-01-16 16:34:29 -08005303@extension("VK_EXT_debug_report")
5304@external type void* PFN_vkDebugReportCallbackEXT
5305@extension("VK_EXT_debug_report")
5306@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5307 VkDebugReportFlagsEXT flags,
5308 VkDebugReportObjectTypeEXT objectType,
5309 u64 object,
5310 platform.size_t location,
5311 s32 messageCode,
5312 const char* pLayerPrefix,
5313 const char* pMessage,
5314 void* pUserData) {
5315 return ?
5316}
5317
5318@extension("VK_EXT_debug_report")
5319cmd VkResult vkCreateDebugReportCallbackEXT(
5320 VkInstance instance,
5321 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5322 const VkAllocationCallbacks* pAllocator,
5323 VkDebugReportCallbackEXT* pCallback) {
5324 return ?
5325}
5326
5327@extension("VK_EXT_debug_report")
5328cmd void vkDestroyDebugReportCallbackEXT(
5329 VkInstance instance,
5330 VkDebugReportCallbackEXT callback,
5331 const VkAllocationCallbacks* pAllocator) {
5332}
5333
5334@extension("VK_EXT_debug_report")
5335cmd void vkDebugReportMessageEXT(
5336 VkInstance instance,
5337 VkDebugReportFlagsEXT flags,
5338 VkDebugReportObjectTypeEXT objectType,
5339 u64 object,
5340 platform.size_t location,
5341 s32 messageCode,
5342 const char* pLayerPrefix,
5343 const char* pMessage) {
5344}
5345
Jesse Hall26763382016-05-20 07:13:52 -07005346@extension("VK_EXT_debug_marker")
5347cmd VkResult vkDebugMarkerSetObjectTagEXT(
5348 VkDevice device,
5349 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5350 return ?
5351}
5352
5353@extension("VK_EXT_debug_marker")
5354cmd VkResult vkDebugMarkerSetObjectNameEXT(
5355 VkDevice device,
5356 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5357 return ?
5358}
5359
5360@extension("VK_EXT_debug_marker")
5361cmd void vkCmdDebugMarkerBeginEXT(
5362 VkCommandBuffer commandBuffer,
5363 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5364}
5365
5366@extension("VK_EXT_debug_marker")
5367cmd void vkCmdDebugMarkerEndEXT(
5368 VkCommandBuffer commandBuffer) {
5369}
5370
5371@extension("VK_EXT_debug_marker")
5372cmd void vkCmdDebugMarkerInsertEXT(
5373 VkCommandBuffer commandBuffer,
5374 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5375}
5376
Jesse Halld27f6aa2015-08-15 17:58:48 -07005377
5378////////////////
5379// Validation //
5380////////////////
5381
5382extern void validate(string layerName, bool condition, string message)
5383
5384
5385/////////////////////////////
5386// Internal State Tracking //
5387/////////////////////////////
5388
5389StateObject State
5390
5391@internal class StateObject {
5392 // Dispatchable objects.
5393 map!(VkInstance, ref!InstanceObject) Instances
5394 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5395 map!(VkDevice, ref!DeviceObject) Devices
5396 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005397 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005398
5399 // Non-dispatchable objects.
5400 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5401 map!(VkBuffer, ref!BufferObject) Buffers
5402 map!(VkBufferView, ref!BufferViewObject) BufferViews
5403 map!(VkImage, ref!ImageObject) Images
5404 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005405 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005406 map!(VkPipeline, ref!PipelineObject) Pipelines
5407 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5408 map!(VkSampler, ref!SamplerObject) Samplers
5409 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5410 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5411 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005412 map!(VkFence, ref!FenceObject) Fences
5413 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5414 map!(VkEvent, ref!EventObject) Events
5415 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5416 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5417 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5418 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005419 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005420 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005421 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005422}
5423
5424@internal class InstanceObject {
5425}
5426
5427@internal class PhysicalDeviceObject {
5428 VkInstance instance
5429}
5430
5431@internal class DeviceObject {
5432 VkPhysicalDevice physicalDevice
5433}
5434
5435@internal class QueueObject {
5436 VkDevice device
5437 VkQueueFlags flags
5438}
5439
Jesse Hall3fbc8562015-11-29 22:10:52 -08005440@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005441 VkDevice device
5442 map!(u64, VkDeviceMemory) boundObjects
5443 VkQueueFlags queueFlags
5444}
5445
5446@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005447 VkDevice device
5448 VkDeviceSize allocationSize
5449 map!(u64, VkDeviceSize) boundObjects
5450 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005451}
5452
5453@internal class BufferObject {
5454 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005455 VkDeviceMemory memory
5456 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005457}
5458
5459@internal class BufferViewObject {
5460 VkDevice device
5461 VkBuffer buffer
5462}
5463
5464@internal class ImageObject {
5465 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005466 VkDeviceMemory memory
5467 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005468}
5469
5470@internal class ImageViewObject {
5471 VkDevice device
5472 VkImage image
5473}
5474
Jesse Halld27f6aa2015-08-15 17:58:48 -07005475@internal class ShaderObject {
5476 VkDevice device
5477}
5478
5479@internal class ShaderModuleObject {
5480 VkDevice device
5481}
5482
5483@internal class PipelineObject {
5484 VkDevice device
5485}
5486
5487@internal class PipelineLayoutObject {
5488 VkDevice device
5489}
5490
5491@internal class SamplerObject {
5492 VkDevice device
5493}
5494
5495@internal class DescriptorSetObject {
5496 VkDevice device
5497}
5498
5499@internal class DescriptorSetLayoutObject {
5500 VkDevice device
5501}
5502
5503@internal class DescriptorPoolObject {
5504 VkDevice device
5505}
5506
Jesse Halld27f6aa2015-08-15 17:58:48 -07005507@internal class FenceObject {
5508 VkDevice device
5509 bool signaled
5510}
5511
5512@internal class SemaphoreObject {
5513 VkDevice device
5514}
5515
5516@internal class EventObject {
5517 VkDevice device
5518}
5519
5520@internal class QueryPoolObject {
5521 VkDevice device
5522}
5523
5524@internal class FramebufferObject {
5525 VkDevice device
5526}
5527
5528@internal class RenderPassObject {
5529 VkDevice device
5530}
5531
5532@internal class PipelineCacheObject {
5533 VkDevice device
5534}
5535
Jesse Hall3fbc8562015-11-29 22:10:52 -08005536@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005537 VkDevice device
5538}
5539
Jesse Hall1356b0d2015-11-23 17:24:58 -08005540@internal class SurfaceObject {
5541 VkInstance instance
5542}
5543
Michael Lentine88594d72015-11-12 12:49:45 -08005544@internal class SwapchainObject {
5545 VkDevice device
5546}
5547
Jesse Halld27f6aa2015-08-15 17:58:48 -07005548macro ref!InstanceObject GetInstance(VkInstance instance) {
5549 assert(instance in State.Instances)
5550 return State.Instances[instance]
5551}
5552
5553macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
5554 assert(physicalDevice in State.PhysicalDevices)
5555 return State.PhysicalDevices[physicalDevice]
5556}
5557
5558macro ref!DeviceObject GetDevice(VkDevice device) {
5559 assert(device in State.Devices)
5560 return State.Devices[device]
5561}
5562
5563macro ref!QueueObject GetQueue(VkQueue queue) {
5564 assert(queue in State.Queues)
5565 return State.Queues[queue]
5566}
5567
Jesse Hall3fbc8562015-11-29 22:10:52 -08005568macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
5569 assert(commandBuffer in State.CommandBuffers)
5570 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005571}
5572
Jesse Hall3fbc8562015-11-29 22:10:52 -08005573macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
5574 assert(memory in State.DeviceMemories)
5575 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005576}
5577
5578macro ref!BufferObject GetBuffer(VkBuffer buffer) {
5579 assert(buffer in State.Buffers)
5580 return State.Buffers[buffer]
5581}
5582
5583macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
5584 assert(bufferView in State.BufferViews)
5585 return State.BufferViews[bufferView]
5586}
5587
5588macro ref!ImageObject GetImage(VkImage image) {
5589 assert(image in State.Images)
5590 return State.Images[image]
5591}
5592
5593macro ref!ImageViewObject GetImageView(VkImageView imageView) {
5594 assert(imageView in State.ImageViews)
5595 return State.ImageViews[imageView]
5596}
5597
Jesse Halld27f6aa2015-08-15 17:58:48 -07005598macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
5599 assert(shaderModule in State.ShaderModules)
5600 return State.ShaderModules[shaderModule]
5601}
5602
5603macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
5604 assert(pipeline in State.Pipelines)
5605 return State.Pipelines[pipeline]
5606}
5607
5608macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
5609 assert(pipelineLayout in State.PipelineLayouts)
5610 return State.PipelineLayouts[pipelineLayout]
5611}
5612
5613macro ref!SamplerObject GetSampler(VkSampler sampler) {
5614 assert(sampler in State.Samplers)
5615 return State.Samplers[sampler]
5616}
5617
5618macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
5619 assert(descriptorSet in State.DescriptorSets)
5620 return State.DescriptorSets[descriptorSet]
5621}
5622
5623macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
5624 assert(descriptorSetLayout in State.DescriptorSetLayouts)
5625 return State.DescriptorSetLayouts[descriptorSetLayout]
5626}
5627
5628macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
5629 assert(descriptorPool in State.DescriptorPools)
5630 return State.DescriptorPools[descriptorPool]
5631}
5632
Jesse Halld27f6aa2015-08-15 17:58:48 -07005633macro ref!FenceObject GetFence(VkFence fence) {
5634 assert(fence in State.Fences)
5635 return State.Fences[fence]
5636}
5637
5638macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
5639 assert(semaphore in State.Semaphores)
5640 return State.Semaphores[semaphore]
5641}
5642
5643macro ref!EventObject GetEvent(VkEvent event) {
5644 assert(event in State.Events)
5645 return State.Events[event]
5646}
5647
5648macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
5649 assert(queryPool in State.QueryPools)
5650 return State.QueryPools[queryPool]
5651}
5652
5653macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
5654 assert(framebuffer in State.Framebuffers)
5655 return State.Framebuffers[framebuffer]
5656}
5657
5658macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
5659 assert(renderPass in State.RenderPasses)
5660 return State.RenderPasses[renderPass]
5661}
5662
5663macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
5664 assert(pipelineCache in State.PipelineCaches)
5665 return State.PipelineCaches[pipelineCache]
5666}
5667
Jesse Hall3fbc8562015-11-29 22:10:52 -08005668macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
5669 assert(commandPool in State.CommandPools)
5670 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07005671}
Michael Lentine88594d72015-11-12 12:49:45 -08005672
Jesse Hall1356b0d2015-11-23 17:24:58 -08005673macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
5674 assert(surface in State.Surfaces)
5675 return State.Surfaces[surface]
5676}
5677
Michael Lentine88594d72015-11-12 12:49:45 -08005678macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
5679 assert(swapchain in State.Swapchains)
5680 return State.Swapchains[swapchain]
5681}
Jesse Halld8bade02015-11-24 10:24:18 -08005682
5683macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
5684 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
5685}