blob: d7358449e4f2dc789c2925de42ab7945f80d41c6 [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 Hall563380d2016-01-15 23:14:05 -080031define VERSION_PATCH 1
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 Hall543a7ff2016-01-08 16:38:30 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 24
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 Hall543a7ff2016-01-08 16:38:30 -080051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 67
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 Hall543a7ff2016-01-08 16:38:30 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 5
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
Jesse Hall715b86a2016-01-16 16:34:29 -080078@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 2
79@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
80
Jesse Halld27f6aa2015-08-15 17:58:48 -070081
82/////////////
83// Types //
84/////////////
85
Jesse Hall5ae3abb2015-10-08 14:00:22 -070086type u32 VkBool32
87type u32 VkFlags
88type u64 VkDeviceSize
89type u32 VkSampleMask
90
Jesse Halld27f6aa2015-08-15 17:58:48 -070091/// Dispatchable handle types.
92@dispatchHandle type u64 VkInstance
93@dispatchHandle type u64 VkPhysicalDevice
94@dispatchHandle type u64 VkDevice
95@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -080096@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -070097
98/// Non dispatchable handle types.
99@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800100@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700101@nonDispatchHandle type u64 VkBuffer
102@nonDispatchHandle type u64 VkBufferView
103@nonDispatchHandle type u64 VkImage
104@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700105@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700106@nonDispatchHandle type u64 VkPipeline
107@nonDispatchHandle type u64 VkPipelineLayout
108@nonDispatchHandle type u64 VkSampler
109@nonDispatchHandle type u64 VkDescriptorSet
110@nonDispatchHandle type u64 VkDescriptorSetLayout
111@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700112@nonDispatchHandle type u64 VkFence
113@nonDispatchHandle type u64 VkSemaphore
114@nonDispatchHandle type u64 VkEvent
115@nonDispatchHandle type u64 VkQueryPool
116@nonDispatchHandle type u64 VkFramebuffer
117@nonDispatchHandle type u64 VkRenderPass
118@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800119
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800120@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800121
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800122@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800123
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800124@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
125@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700126
Jesse Hall715b86a2016-01-16 16:34:29 -0800127@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
128
Jesse Halld27f6aa2015-08-15 17:58:48 -0700129
130/////////////
131// Enums //
132/////////////
133
134enum VkImageLayout {
135 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
136 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
137 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
138 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
139 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
140 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 -0800141 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
142 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 -0700143 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800144
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800145 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800146 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700147}
148
149enum VkAttachmentLoadOp {
150 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
151 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
152 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
153}
154
155enum VkAttachmentStoreOp {
156 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
157 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
158}
159
160enum VkImageType {
161 VK_IMAGE_TYPE_1D = 0x00000000,
162 VK_IMAGE_TYPE_2D = 0x00000001,
163 VK_IMAGE_TYPE_3D = 0x00000002,
164}
165
166enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800167 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
168 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700169}
170
171enum VkImageViewType {
172 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
173 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
174 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
175 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
176 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
177 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
178 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
179}
180
Jesse Hall3fbc8562015-11-29 22:10:52 -0800181enum VkCommandBufferLevel {
182 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
183 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700184}
185
Jesse Hall65ab5522015-11-30 00:07:16 -0800186enum VkComponentSwizzle {
187 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
188 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
189 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
190 VK_COMPONENT_SWIZZLE_R = 0x00000003,
191 VK_COMPONENT_SWIZZLE_G = 0x00000004,
192 VK_COMPONENT_SWIZZLE_B = 0x00000005,
193 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700194}
195
196enum VkDescriptorType {
197 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
198 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
199 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
200 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
201 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
202 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
203 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
204 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
205 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
206 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
207 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
208}
209
Jesse Halld27f6aa2015-08-15 17:58:48 -0700210enum VkQueryType {
211 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
212 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800213 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700214}
215
Jesse Halld27f6aa2015-08-15 17:58:48 -0700216enum VkBorderColor {
217 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
218 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
219 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
220 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
221 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
222 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
223}
224
225enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800226 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
227 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700228}
229
230enum VkPrimitiveTopology {
231 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
232 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
233 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
234 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
235 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
236 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800237 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
238 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
239 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
240 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800241 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700242}
243
244enum VkSharingMode {
245 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
246 VK_SHARING_MODE_CONCURRENT = 0x00000001,
247}
248
249enum VkIndexType {
250 VK_INDEX_TYPE_UINT16 = 0x00000000,
251 VK_INDEX_TYPE_UINT32 = 0x00000001,
252}
253
Jesse Hall23ff73f2015-11-29 14:36:39 -0800254enum VkFilter {
255 VK_FILTER_NEAREST = 0x00000000,
256 VK_FILTER_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700257}
258
Jesse Hall23ff73f2015-11-29 14:36:39 -0800259enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800260 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
261 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700262}
263
Jesse Hall23ff73f2015-11-29 14:36:39 -0800264enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800265 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
266 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
267 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
268 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
269 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700270}
271
272enum VkCompareOp {
273 VK_COMPARE_OP_NEVER = 0x00000000,
274 VK_COMPARE_OP_LESS = 0x00000001,
275 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800276 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700277 VK_COMPARE_OP_GREATER = 0x00000004,
278 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800279 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700280 VK_COMPARE_OP_ALWAYS = 0x00000007,
281}
282
Jesse Hall65ab5522015-11-30 00:07:16 -0800283enum VkPolygonMode {
284 VK_POLYGON_MODE_FILL = 0x00000000,
285 VK_POLYGON_MODE_LINE = 0x00000001,
286 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700287}
288
289enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800290 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
291 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700292}
293
Jesse Hall65ab5522015-11-30 00:07:16 -0800294enum VkBlendFactor {
295 VK_BLEND_FACTOR_ZERO = 0x00000000,
296 VK_BLEND_FACTOR_ONE = 0x00000001,
297 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
298 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
299 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
300 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
301 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
302 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
303 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
304 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
305 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
306 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
307 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
308 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
309 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
310 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
311 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
312 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
313 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700314}
315
316enum VkBlendOp {
317 VK_BLEND_OP_ADD = 0x00000000,
318 VK_BLEND_OP_SUBTRACT = 0x00000001,
319 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
320 VK_BLEND_OP_MIN = 0x00000003,
321 VK_BLEND_OP_MAX = 0x00000004,
322}
323
324enum VkStencilOp {
325 VK_STENCIL_OP_KEEP = 0x00000000,
326 VK_STENCIL_OP_ZERO = 0x00000001,
327 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800328 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
329 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700330 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800331 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
332 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700333}
334
335enum VkLogicOp {
336 VK_LOGIC_OP_CLEAR = 0x00000000,
337 VK_LOGIC_OP_AND = 0x00000001,
338 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
339 VK_LOGIC_OP_COPY = 0x00000003,
340 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800341 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700342 VK_LOGIC_OP_XOR = 0x00000006,
343 VK_LOGIC_OP_OR = 0x00000007,
344 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800345 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700346 VK_LOGIC_OP_INVERT = 0x0000000a,
347 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
348 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
349 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
350 VK_LOGIC_OP_NAND = 0x0000000e,
351 VK_LOGIC_OP_SET = 0x0000000f,
352}
353
Jesse Hall3fbc8562015-11-29 22:10:52 -0800354enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800355 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800356 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
357 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
358 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
359 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800360}
361
Jesse Hall3fbc8562015-11-29 22:10:52 -0800362enum VkInternalAllocationType {
363 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700364}
365
366enum VkPhysicalDeviceType {
367 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
368 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
369 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
370 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
371 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
372}
373
Jesse Hall65ab5522015-11-30 00:07:16 -0800374enum VkVertexInputRate {
375 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
376 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700377}
378
379/// Vulkan format definitions
380enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800381 VK_FORMAT_UNDEFINED = 0,
382 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
383 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
384 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
385 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
386 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
387 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
388 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
389 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
390 VK_FORMAT_R8_UNORM = 9,
391 VK_FORMAT_R8_SNORM = 10,
392 VK_FORMAT_R8_USCALED = 11,
393 VK_FORMAT_R8_SSCALED = 12,
394 VK_FORMAT_R8_UINT = 13,
395 VK_FORMAT_R8_SINT = 14,
396 VK_FORMAT_R8_SRGB = 15,
397 VK_FORMAT_R8G8_UNORM = 16,
398 VK_FORMAT_R8G8_SNORM = 17,
399 VK_FORMAT_R8G8_USCALED = 18,
400 VK_FORMAT_R8G8_SSCALED = 19,
401 VK_FORMAT_R8G8_UINT = 20,
402 VK_FORMAT_R8G8_SINT = 21,
403 VK_FORMAT_R8G8_SRGB = 22,
404 VK_FORMAT_R8G8B8_UNORM = 23,
405 VK_FORMAT_R8G8B8_SNORM = 24,
406 VK_FORMAT_R8G8B8_USCALED = 25,
407 VK_FORMAT_R8G8B8_SSCALED = 26,
408 VK_FORMAT_R8G8B8_UINT = 27,
409 VK_FORMAT_R8G8B8_SINT = 28,
410 VK_FORMAT_R8G8B8_SRGB = 29,
411 VK_FORMAT_B8G8R8_UNORM = 30,
412 VK_FORMAT_B8G8R8_SNORM = 31,
413 VK_FORMAT_B8G8R8_USCALED = 32,
414 VK_FORMAT_B8G8R8_SSCALED = 33,
415 VK_FORMAT_B8G8R8_UINT = 34,
416 VK_FORMAT_B8G8R8_SINT = 35,
417 VK_FORMAT_B8G8R8_SRGB = 36,
418 VK_FORMAT_R8G8B8A8_UNORM = 37,
419 VK_FORMAT_R8G8B8A8_SNORM = 38,
420 VK_FORMAT_R8G8B8A8_USCALED = 39,
421 VK_FORMAT_R8G8B8A8_SSCALED = 40,
422 VK_FORMAT_R8G8B8A8_UINT = 41,
423 VK_FORMAT_R8G8B8A8_SINT = 42,
424 VK_FORMAT_R8G8B8A8_SRGB = 43,
425 VK_FORMAT_B8G8R8A8_UNORM = 44,
426 VK_FORMAT_B8G8R8A8_SNORM = 45,
427 VK_FORMAT_B8G8R8A8_USCALED = 46,
428 VK_FORMAT_B8G8R8A8_SSCALED = 47,
429 VK_FORMAT_B8G8R8A8_UINT = 48,
430 VK_FORMAT_B8G8R8A8_SINT = 49,
431 VK_FORMAT_B8G8R8A8_SRGB = 50,
432 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
433 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
434 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
435 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
436 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
437 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
438 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
439 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
440 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
441 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
442 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
443 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
444 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
445 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
446 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
447 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
448 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
449 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
450 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
451 VK_FORMAT_R16_UNORM = 70,
452 VK_FORMAT_R16_SNORM = 71,
453 VK_FORMAT_R16_USCALED = 72,
454 VK_FORMAT_R16_SSCALED = 73,
455 VK_FORMAT_R16_UINT = 74,
456 VK_FORMAT_R16_SINT = 75,
457 VK_FORMAT_R16_SFLOAT = 76,
458 VK_FORMAT_R16G16_UNORM = 77,
459 VK_FORMAT_R16G16_SNORM = 78,
460 VK_FORMAT_R16G16_USCALED = 79,
461 VK_FORMAT_R16G16_SSCALED = 80,
462 VK_FORMAT_R16G16_UINT = 81,
463 VK_FORMAT_R16G16_SINT = 82,
464 VK_FORMAT_R16G16_SFLOAT = 83,
465 VK_FORMAT_R16G16B16_UNORM = 84,
466 VK_FORMAT_R16G16B16_SNORM = 85,
467 VK_FORMAT_R16G16B16_USCALED = 86,
468 VK_FORMAT_R16G16B16_SSCALED = 87,
469 VK_FORMAT_R16G16B16_UINT = 88,
470 VK_FORMAT_R16G16B16_SINT = 89,
471 VK_FORMAT_R16G16B16_SFLOAT = 90,
472 VK_FORMAT_R16G16B16A16_UNORM = 91,
473 VK_FORMAT_R16G16B16A16_SNORM = 92,
474 VK_FORMAT_R16G16B16A16_USCALED = 93,
475 VK_FORMAT_R16G16B16A16_SSCALED = 94,
476 VK_FORMAT_R16G16B16A16_UINT = 95,
477 VK_FORMAT_R16G16B16A16_SINT = 96,
478 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
479 VK_FORMAT_R32_UINT = 98,
480 VK_FORMAT_R32_SINT = 99,
481 VK_FORMAT_R32_SFLOAT = 100,
482 VK_FORMAT_R32G32_UINT = 101,
483 VK_FORMAT_R32G32_SINT = 102,
484 VK_FORMAT_R32G32_SFLOAT = 103,
485 VK_FORMAT_R32G32B32_UINT = 104,
486 VK_FORMAT_R32G32B32_SINT = 105,
487 VK_FORMAT_R32G32B32_SFLOAT = 106,
488 VK_FORMAT_R32G32B32A32_UINT = 107,
489 VK_FORMAT_R32G32B32A32_SINT = 108,
490 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
491 VK_FORMAT_R64_UINT = 110,
492 VK_FORMAT_R64_SINT = 111,
493 VK_FORMAT_R64_SFLOAT = 112,
494 VK_FORMAT_R64G64_UINT = 113,
495 VK_FORMAT_R64G64_SINT = 114,
496 VK_FORMAT_R64G64_SFLOAT = 115,
497 VK_FORMAT_R64G64B64_UINT = 116,
498 VK_FORMAT_R64G64B64_SINT = 117,
499 VK_FORMAT_R64G64B64_SFLOAT = 118,
500 VK_FORMAT_R64G64B64A64_UINT = 119,
501 VK_FORMAT_R64G64B64A64_SINT = 120,
502 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
503 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
504 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
505 VK_FORMAT_D16_UNORM = 124,
506 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
507 VK_FORMAT_D32_SFLOAT = 126,
508 VK_FORMAT_S8_UINT = 127,
509 VK_FORMAT_D16_UNORM_S8_UINT = 128,
510 VK_FORMAT_D24_UNORM_S8_UINT = 129,
511 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
512 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
513 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
514 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
515 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
516 VK_FORMAT_BC2_UNORM_BLOCK = 135,
517 VK_FORMAT_BC2_SRGB_BLOCK = 136,
518 VK_FORMAT_BC3_UNORM_BLOCK = 137,
519 VK_FORMAT_BC3_SRGB_BLOCK = 138,
520 VK_FORMAT_BC4_UNORM_BLOCK = 139,
521 VK_FORMAT_BC4_SNORM_BLOCK = 140,
522 VK_FORMAT_BC5_UNORM_BLOCK = 141,
523 VK_FORMAT_BC5_SNORM_BLOCK = 142,
524 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
525 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
526 VK_FORMAT_BC7_UNORM_BLOCK = 145,
527 VK_FORMAT_BC7_SRGB_BLOCK = 146,
528 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
529 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
530 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
531 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
532 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
533 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
534 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
535 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
536 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
537 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
538 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
539 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
540 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
541 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
542 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
543 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
544 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
545 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
546 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
547 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
548 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
549 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
550 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
551 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
552 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
553 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
554 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
555 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
556 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
557 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
558 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
559 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
560 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
561 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
562 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
563 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
564 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
565 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700566}
567
Jesse Halld27f6aa2015-08-15 17:58:48 -0700568/// Structure type enumerant
569enum VkStructureType {
570 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800571 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
572 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
573 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
574 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800575 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800576 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
577 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
578 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
579 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700580 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800581 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
582 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
583 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
584 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
585 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
586 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800587 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
588 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
589 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
590 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
591 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
592 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
593 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
594 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
595 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
596 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
597 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
598 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
599 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
600 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
601 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
602 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
603 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800604 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800605 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
606 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
607 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
608 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
609 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800610 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800611 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
612 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
613 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
614 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
615 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
616 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
617 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
618 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800619
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800620 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800621 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
622 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800623
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800624 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800625 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
626 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800627
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800628 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800629 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800630
631 //@extension("VK_KHR_xlib_surface")
632 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
633
634 //@extension("VK_KHR_xcb_surface")
635 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
636
637 //@extension("VK_KHR_wayland_surface")
638 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
639
640 //@extension("VK_KHR_mir_surface")
641 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
642
643 //@extension("VK_KHR_android_surface")
644 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
645
646 //@extension("VK_KHR_win32_surface")
647 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800648
649 //@extension("VK_EXT_debug_report")
650 VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = 1000011000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700651}
652
Jesse Hall65ab5522015-11-30 00:07:16 -0800653enum VkSubpassContents {
654 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
655 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700656}
657
Jesse Hall543a7ff2016-01-08 16:38:30 -0800658enum VkPipelineCacheHeaderVersion {
659 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
660}
661
Jesse Hallbd888842015-11-30 21:44:14 -0800662@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700663/// Error and return codes
664enum VkResult {
665 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800666 VK_SUCCESS = 0,
667 VK_NOT_READY = 1,
668 VK_TIMEOUT = 2,
669 VK_EVENT_SET = 3,
670 VK_EVENT_RESET = 4,
671 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700672
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800673 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800674 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800675
Jesse Halld27f6aa2015-08-15 17:58:48 -0700676 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800677 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
678 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
679 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
680 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
681 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
682 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
683 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
684 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
685 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
686 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
687 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall1356b0d2015-11-23 17:24:58 -0800688
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800689 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800690 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800691
Jesse Hall563380d2016-01-15 23:14:05 -0800692 //@extension("VK_KHR_surface")
693 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
694
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800695 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800696 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800697
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800698 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800699 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800700
Jesse Hall543a7ff2016-01-08 16:38:30 -0800701 //@extension("VK_EXT_debug_report")
702 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700703}
704
705enum VkDynamicState {
706 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
707 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
708 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
709 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
710 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
711 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
712 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
713 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
714 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700715}
716
Jesse Hall523db342015-11-30 21:12:55 -0800717@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800718enum VkPresentModeKHR {
719 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
720 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
721 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800722 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800723}
724
Jesse Hall523db342015-11-30 21:12:55 -0800725@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800726enum VkColorSpaceKHR {
727 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
728}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700729
Jesse Hall715b86a2016-01-16 16:34:29 -0800730@extension("VK_EXT_debug_report")
731enum VkDebugReportObjectTypeEXT {
732 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
733 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
734 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
735 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
736 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
737 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
738 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
739 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
740 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
741 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
742 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
743 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
744 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
745 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
746 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
747 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
748 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
749 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
750 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
751 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
752 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
753 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
754 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
755 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
756 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
757 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
758 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
759 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
760 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
761}
762
763@extension("VK_EXT_debug_report")
764enum VkDebugReportErrorEXT {
765 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
766 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
767}
768
769
Jesse Halld27f6aa2015-08-15 17:58:48 -0700770/////////////////
771// Bitfields //
772/////////////////
773
Jesse Halld27f6aa2015-08-15 17:58:48 -0700774/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -0800775type VkFlags VkQueueFlags
776bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700777 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
778 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -0800779 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -0800780 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700781}
782
783/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -0800784type VkFlags VkMemoryPropertyFlags
785bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800786 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
787 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
788 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
789 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
790 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700791}
792
793/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -0800794type VkFlags VkMemoryHeapFlags
795bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800796 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700797}
798
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800799/// Access flags
800type VkFlags VkAccessFlags
801bitfield VkAccessFlagBits {
802 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
803 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
804 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
805 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
806 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
807 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
808 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
809 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
810 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
811 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
812 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
813 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
814 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
815 VK_ACCESS_HOST_READ_BIT = 0x00002000,
816 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
817 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
818 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700819}
820
821/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800822type VkFlags VkBufferUsageFlags
823bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800824 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
825 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700826 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
827 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
828 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
829 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
830 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
831 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
832 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
833}
834
835/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800836type VkFlags VkBufferCreateFlags
837bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700838 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700839 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
840 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
841}
842
843/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800844type VkFlags VkShaderStageFlags
845bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700846 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -0800847 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
848 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700849 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
850 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
851 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -0800852 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700853
854 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
855}
856
Jesse Hallfbf97b02015-11-20 14:17:03 -0800857/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -0800858type VkFlags VkDescriptorPoolCreateFlags
859bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800860 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
861}
862
863/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -0800864type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -0800865//bitfield VkDescriptorPoolResetFlagBits {
866//}
Jesse Hallfbf97b02015-11-20 14:17:03 -0800867
Jesse Halld27f6aa2015-08-15 17:58:48 -0700868/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800869type VkFlags VkImageUsageFlags
870bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800871 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
872 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700873 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
874 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
875 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700876 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -0700877 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
878 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
879}
880
881/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800882type VkFlags VkImageCreateFlags
883bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700884 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700885 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
886 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 -0700887 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
888 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 -0700889}
890
Jesse Hallb00daad2015-11-29 19:46:20 -0800891/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800892type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -0800893//bitfield VkImageViewCreateFlagBits {
894//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700895
896/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800897type VkFlags VkPipelineCreateFlags
898bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700899 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
900 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
901 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
902}
903
Jesse Hall65ab5522015-11-30 00:07:16 -0800904/// Color component flags
905type VkFlags VkColorComponentFlags
906bitfield VkColorComponentFlagBits {
907 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
908 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
909 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
910 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700911}
912
913/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800914type VkFlags VkFenceCreateFlags
915bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700916 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
917}
918
919/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800920type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800921//bitfield VkSemaphoreCreateFlagBits {
922//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700923
924/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -0800925type VkFlags VkFormatFeatureFlags
926bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700927 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
928 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
929 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
930 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
931 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
932 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
933 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
934 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
935 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
936 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -0800937 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
938 VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCommandBlitImage
Jesse Halld27f6aa2015-08-15 17:58:48 -0700939}
940
941/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -0800942type VkFlags VkQueryControlFlags
943bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -0800944 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700945}
946
947/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -0800948type VkFlags VkQueryResultFlags
949bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700950 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
951 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
952 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
953 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
954}
955
956/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800957type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800958//bitfield VkShaderModuleCreateFlagBits {
959//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700960
Jesse Halld27f6aa2015-08-15 17:58:48 -0700961/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800962type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800963//bitfield VkEventCreateFlagBits {
964//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700965
Jesse Halla15a4bf2015-11-19 22:48:02 -0800966/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -0800967type VkFlags VkCommandBufferUsageFlags
968bitfield VkCommandBufferUsageFlagBits {
969 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
970 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
971 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700972}
973
974/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -0800975type VkFlags VkQueryPipelineStatisticFlags
976bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -0800977 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
978 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
979 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
980 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
981 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
982 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
983 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
984 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
985 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
986 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
987 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -0700988}
989
990/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -0800991type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -0800992//bitfield VkMemoryMapFlagBits {
993//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700994
995/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -0800996type VkFlags VkImageAspectFlags
997bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700998 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
999 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1000 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1001 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1002}
1003
1004/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001005type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001006bitfield VkSparseMemoryBindFlagBits {
1007 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1008}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001009
1010/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001011type VkFlags VkSparseImageFormatFlags
1012bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001013 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1014 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.
1015 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001016}
1017
1018/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001019type VkFlags VkPipelineStageFlags
1020bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001021 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1022 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1023 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1024 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001025 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1026 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001027 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1028 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1029 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1030 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1031 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1032 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1033 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001034 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1035 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001036
Jesse Hall543a7ff2016-01-08 16:38:30 -08001037 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1038 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001039}
1040
1041/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001042type VkFlags VkAttachmentDescriptionFlags
1043bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001044 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 -07001045}
1046
1047/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001048type VkFlags VkSubpassDescriptionFlags
1049bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001050}
1051
1052/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001053type VkFlags VkCommandPoolCreateFlags
1054bitfield VkCommandPoolCreateFlagBits {
1055 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1056 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001057}
1058
1059/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001060type VkFlags VkCommandPoolResetFlags
1061bitfield VkCommandPoolResetFlagBits {
1062 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001063}
1064
Jesse Hall3fbc8562015-11-29 22:10:52 -08001065type VkFlags VkCommandBufferResetFlags
1066bitfield VkCommandBufferResetFlagBits {
1067 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001068}
1069
Jesse Halld8bade02015-11-24 10:24:18 -08001070type VkFlags VkSampleCountFlags
1071bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001072 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1073 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1074 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1075 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1076 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1077 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1078 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1079}
1080
Jesse Halld8bade02015-11-24 10:24:18 -08001081type VkFlags VkStencilFaceFlags
1082bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001083 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1084 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001085 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001086}
1087
Jesse Halla6429252015-11-29 18:59:42 -08001088/// Instance creation flags
1089type VkFlags VkInstanceCreateFlags
1090//bitfield VkInstanceCreateFlagBits {
1091//}
1092
1093/// Device creation flags
1094type VkFlags VkDeviceCreateFlags
1095//bitfield VkDeviceCreateFlagBits {
1096//}
1097
1098/// Device queue creation flags
1099type VkFlags VkDeviceQueueCreateFlags
1100//bitfield VkDeviceQueueCreateFlagBits {
1101//}
1102
1103/// Query pool creation flags
1104type VkFlags VkQueryPoolCreateFlags
1105//bitfield VkQueryPoolCreateFlagBits {
1106//}
1107
1108/// Buffer view creation flags
1109type VkFlags VkBufferViewCreateFlags
1110//bitfield VkBufferViewCreateFlagBits {
1111//}
1112
1113/// Pipeline cache creation flags
1114type VkFlags VkPipelineCacheCreateFlags
1115//bitfield VkPipelineCacheCreateFlagBits {
1116//}
1117
1118/// Pipeline shader stage creation flags
1119type VkFlags VkPipelineShaderStageCreateFlags
1120//bitfield VkPipelineShaderStageCreateFlagBits {
1121//}
1122
1123/// Descriptor set layout creation flags
1124type VkFlags VkDescriptorSetLayoutCreateFlags
1125//bitfield VkDescriptorSetLayoutCreateFlagBits {
1126//}
1127
1128/// Pipeline vertex input state creation flags
1129type VkFlags VkPipelineVertexInputStateCreateFlags
1130//bitfield VkPipelineVertexInputStateCreateFlagBits {
1131//}
1132
1133/// Pipeline input assembly state creation flags
1134type VkFlags VkPipelineInputAssemblyStateCreateFlags
1135//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1136//}
1137
1138/// Tessellation state creation flags
1139type VkFlags VkPipelineTessellationStateCreateFlags
1140//bitfield VkPipelineTessellationStateCreateFlagBits {
1141//}
1142
1143/// Viewport state creation flags
1144type VkFlags VkPipelineViewportStateCreateFlags
1145//bitfield VkPipelineViewportStateCreateFlagBits {
1146//}
1147
Jesse Hall3fbc8562015-11-29 22:10:52 -08001148/// Rasterization state creation flags
1149type VkFlags VkPipelineRasterizationStateCreateFlags
1150//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001151//}
1152
1153/// Multisample state creation flags
1154type VkFlags VkPipelineMultisampleStateCreateFlags
1155//bitfield VkPipelineMultisampleStateCreateFlagBits {
1156//}
1157
1158/// Color blend state creation flags
1159type VkFlags VkPipelineColorBlendStateCreateFlags
1160//bitfield VkPipelineColorBlendStateCreateFlagBits {
1161//}
1162
1163/// Depth/stencil state creation flags
1164type VkFlags VkPipelineDepthStencilStateCreateFlags
1165//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1166//}
1167
1168/// Dynamic state creation flags
1169type VkFlags VkPipelineDynamicStateCreateFlags
1170//bitfield VkPipelineDynamicStateCreateFlagBits {
1171//}
1172
1173/// Pipeline layout creation flags
1174type VkFlags VkPipelineLayoutCreateFlags
1175//bitfield VkPipelineLayoutCreateFlagBits {
1176//}
1177
1178/// Sampler creation flags
1179type VkFlags VkSamplerCreateFlags
1180//bitfield VkSamplerCreateFlagBits {
1181//}
1182
1183/// Render pass creation flags
1184type VkFlags VkRenderPassCreateFlags
1185//bitfield VkRenderPassCreateFlagBits {
1186//}
1187
1188/// Framebuffer creation flags
1189type VkFlags VkFramebufferCreateFlags
1190//bitfield VkFramebufferCreateFlagBits {
1191//}
1192
Jesse Halldc6d36c2015-11-29 19:12:15 -08001193/// Dependency flags
1194type VkFlags VkDependencyFlags
1195bitfield VkDependencyFlagBits {
1196 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1197}
1198
Jesse Hallc7467b72015-11-29 21:05:26 -08001199/// Cull mode flags
1200type VkFlags VkCullModeFlags
1201bitfield VkCullModeFlagBits {
1202 VK_CULL_MODE_NONE = 0x00000000,
1203 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1204 VK_CULL_MODE_BACK_BIT = 0x00000002,
1205 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1206}
1207
Jesse Hall523db342015-11-30 21:12:55 -08001208@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001209type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001210@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001211bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001212 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001213 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1214 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1215 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1216 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1217 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1218 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1219 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1220 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001221}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001222
Jesse Hall523db342015-11-30 21:12:55 -08001223@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001224type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001225@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001226bitfield VkCompositeAlphaFlagBitsKHR {
1227 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1228 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1229 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1230 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1231}
1232
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001233@extension("VK_KHR_swapchain")
1234type VkFlags VkSwapchainCreateFlagsKHR
1235//@extension("VK_KHR_swapchain")
1236//bitfield VkSwapchainCreateFlagBitsKHR {
1237//}
1238
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001239@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001240type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001241@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001242bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001243 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1244 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1245 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1246 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001247}
1248
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001249@extension("VK_KHR_display")
1250type VkFlags VkDisplaySurfaceCreateFlagsKHR
1251//@extension("VK_KHR_display")
1252//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1253//}
1254
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001255@extension("VK_KHR_display")
1256type VkFlags VkDisplayModeCreateFlagsKHR
1257//@extension("VK_KHR_display")
1258//bitfield VkDisplayModeCreateFlagBitsKHR {
1259//}
1260
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001261@extension("VK_KHR_xlib_surface")
1262type VkFlags VkXlibSurfaceCreateFlagsKHR
1263//@extension("VK_KHR_xlib_surface")
1264//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1265//}
1266
1267@extension("VK_KHR_xcb_surface")
1268type VkFlags VkXcbSurfaceCreateFlagsKHR
1269//@extension("VK_KHR_xcb_surface")
1270//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1271//}
1272
1273@extension("VK_KHR_wayland_surface")
1274type VkFlags VkWaylandSurfaceCreateFlagsKHR
1275//@extension("VK_KHR_wayland_surface")
1276//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1277//}
1278
1279@extension("VK_KHR_mir_surface")
1280type VkFlags VkMirSurfaceCreateFlagsKHR
1281//@extension("VK_KHR_mir_surface")
1282//bitfield VkMirSurfaceCreateFlagBitsKHR {
1283//}
1284
1285@extension("VK_KHR_android_surface")
1286type VkFlags VkAndroidSurfaceCreateFlagsKHR
1287//@extension("VK_KHR_android_surface")
1288//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1289//}
1290
1291@extension("VK_KHR_win32_surface")
1292type VkFlags VkWin32SurfaceCreateFlagsKHR
1293//@extension("VK_KHR_win32_surface")
1294//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1295//}
1296
Jesse Hall715b86a2016-01-16 16:34:29 -08001297@extension("VK_EXT_debug_report")
1298type VkFlags VkDebugReportFlagsEXT
1299@extension("VK_EXT_debug_report")
1300bitfield VkDebugReportFlagBitsEXT {
1301 VK_DEBUG_REPORT_INFO_BIT_EXT = 0x00000001,
1302 VK_DEBUG_REPORT_WARN_BIT_EXT = 0x00000002,
1303 VK_DEBUG_REPORT_PERF_WARN_BIT_EXT = 0x00000004,
1304 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1305 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1306}
1307
Jesse Hall1356b0d2015-11-23 17:24:58 -08001308
Jesse Halld27f6aa2015-08-15 17:58:48 -07001309//////////////////
1310// Structures //
1311//////////////////
1312
1313class VkOffset2D {
1314 s32 x
1315 s32 y
1316}
1317
1318class VkOffset3D {
1319 s32 x
1320 s32 y
1321 s32 z
1322}
1323
1324class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001325 u32 width
1326 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001327}
1328
1329class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001330 u32 width
1331 u32 height
1332 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001333}
1334
1335class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001336 f32 x
1337 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001338 f32 width
1339 f32 height
1340 f32 minDepth
1341 f32 maxDepth
1342}
1343
1344class VkRect2D {
1345 VkOffset2D offset
1346 VkExtent2D extent
1347}
1348
Jesse Halla15a4bf2015-11-19 22:48:02 -08001349class VkClearRect {
1350 VkRect2D rect
1351 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001352 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001353}
1354
Jesse Hall65ab5522015-11-30 00:07:16 -08001355class VkComponentMapping {
1356 VkComponentSwizzle r
1357 VkComponentSwizzle g
1358 VkComponentSwizzle b
1359 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001360}
1361
1362class VkPhysicalDeviceProperties {
1363 u32 apiVersion
1364 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001365 u32 vendorID
1366 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001367 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001368 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1369 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001370 VkPhysicalDeviceLimits limits
1371 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001372}
1373
1374class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001375 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001376 u32 specVersion /// version of the extension specification implemented
1377}
1378
1379class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001380 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001381 u32 specVersion /// version of the layer specification implemented
1382 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001383 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001384}
1385
Jesse Halla366a512015-11-19 22:30:07 -08001386class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001387 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1388 const void* pNext /// Next structure in chain
1389 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001390 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001391 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001392 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001393 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001394 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001395 const VkSemaphore* pSignalSemaphores
1396}
1397
Jesse Halld27f6aa2015-08-15 17:58:48 -07001398class VkApplicationInfo {
1399 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1400 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001401 const char* pApplicationName
1402 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001403 const char* pEngineName
1404 u32 engineVersion
1405 u32 apiVersion
1406}
1407
Jesse Hall3fbc8562015-11-29 22:10:52 -08001408class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001409 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001410 PFN_vkAllocationFunction pfnAllocation
1411 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001412 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001413 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001414 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001415}
1416
1417class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001418 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1419 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001420 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001421 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001422 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001423 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001424}
1425
1426class VkDeviceCreateInfo {
1427 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1428 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001429 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001430 u32 queueCreateInfoCount
1431 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001432 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001433 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001434 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001435 const char* const* ppEnabledExtensionNames
1436 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001437}
1438
1439class VkInstanceCreateInfo {
1440 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1441 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001442 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001443 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001444 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001445 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001446 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001447 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1448}
1449
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001450class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001451 VkQueueFlags queueFlags /// Queue flags
1452 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001453 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001454 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001455}
1456
1457class VkPhysicalDeviceMemoryProperties {
1458 u32 memoryTypeCount
1459 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1460 u32 memoryHeapCount
1461 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1462}
1463
Jesse Hall3fbc8562015-11-29 22:10:52 -08001464class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001465 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001466 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001467 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001468 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1469}
1470
1471class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001472 VkDeviceSize size /// Specified in bytes
1473 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001474 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1475}
1476
1477class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001478 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001479 VkExtent3D imageGranularity
1480 VkSparseImageFormatFlags flags
1481}
1482
1483class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001484 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001485 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001486 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1487 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1488 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001489}
1490
1491class VkMemoryType {
1492 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1493 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1494}
1495
1496class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001497 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001498 VkMemoryHeapFlags flags /// Flags for the heap
1499}
1500
1501class VkMappedMemoryRange {
1502 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1503 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001504 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001505 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1506 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001507}
1508
1509class VkFormatProperties {
1510 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1511 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001512 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001513}
1514
1515class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001516 VkExtent3D maxExtent /// max image dimensions for this resource type
1517 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001518 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001519 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1520 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1521}
1522
Jesse Halla15a4bf2015-11-19 22:48:02 -08001523class VkDescriptorImageInfo {
1524 VkSampler sampler
1525 VkImageView imageView
1526 VkImageLayout imageLayout
1527}
1528
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001529class VkDescriptorBufferInfo {
1530 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1531 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1532 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001533}
1534
Jesse Halld27f6aa2015-08-15 17:58:48 -07001535class VkWriteDescriptorSet {
1536 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1537 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001538 VkDescriptorSet dstSet /// Destination descriptor set
1539 u32 dstBinding /// Binding within the destination descriptor set to write
1540 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001541 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001542 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 -08001543 const VkDescriptorImageInfo* pImageInfo
1544 const VkDescriptorBufferInfo* pBufferInfo
1545 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001546}
1547
1548class VkCopyDescriptorSet {
1549 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1550 const void* pNext /// Pointer to next structure
1551 VkDescriptorSet srcSet /// Source descriptor set
1552 u32 srcBinding /// Binding within the source descriptor set to copy from
1553 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001554 VkDescriptorSet dstSet /// Destination descriptor set
1555 u32 dstBinding /// Binding within the destination descriptor set to copy to
1556 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001557 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001558}
1559
1560class VkBufferCreateInfo {
1561 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1562 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001563 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001564 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001565 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001566 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001567 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001568 const u32* pQueueFamilyIndices
1569}
1570
1571class VkBufferViewCreateInfo {
1572 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1573 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001574 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001575 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001576 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001577 VkDeviceSize offset /// Specified in bytes
1578 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001579}
1580
1581class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001582 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001583 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001584 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001585}
1586
1587class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001588 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001589 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001590 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001591 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001592 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001593}
1594
1595class VkMemoryBarrier {
1596 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1597 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001598 VkAccessFlags srcAccessMask
1599 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001600}
1601
1602class VkBufferMemoryBarrier {
1603 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1604 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001605 VkAccessFlags srcAccessMask
1606 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001607 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001608 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001609 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001610 VkDeviceSize offset /// Offset within the buffer to sync
1611 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001612}
1613
1614class VkImageMemoryBarrier {
1615 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1616 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001617 VkAccessFlags srcAccessMask
1618 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001619 VkImageLayout oldLayout /// Current layout of the image
1620 VkImageLayout newLayout /// New layout to transition the image to
1621 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001622 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001623 VkImage image /// Image to sync
1624 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1625}
1626
1627class VkImageCreateInfo {
1628 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1629 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001630 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001631 VkImageType imageType
1632 VkFormat format
1633 VkExtent3D extent
1634 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001635 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001636 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001637 VkImageTiling tiling
1638 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001639 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001640 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001641 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001642 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001643}
1644
1645class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001646 VkDeviceSize offset /// Specified in bytes
1647 VkDeviceSize size /// Specified in bytes
1648 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001649 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001650 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001651}
1652
1653class VkImageViewCreateInfo {
1654 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1655 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001656 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001657 VkImage image
1658 VkImageViewType viewType
1659 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001660 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001661 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001662}
1663
1664class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001665 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001666 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001667 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001668}
1669
Jesse Halla6429252015-11-29 18:59:42 -08001670class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001671 VkDeviceSize resourceOffset /// Specified in bytes
1672 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001673 VkDeviceMemory memory
1674 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001675 VkSparseMemoryBindFlags flags
1676}
1677
Jesse Halla6429252015-11-29 18:59:42 -08001678class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001679 VkImageSubresource subresource
1680 VkOffset3D offset
1681 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001682 VkDeviceMemory memory
1683 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001684 VkSparseMemoryBindFlags flags
1685}
1686
Jesse Halla6429252015-11-29 18:59:42 -08001687class VkSparseBufferMemoryBindInfo {
1688 VkBuffer buffer
1689 u32 bindCount
1690 const VkSparseMemoryBind* pBinds
1691}
1692
1693class VkSparseImageOpaqueMemoryBindInfo {
1694 VkImage image
1695 u32 bindCount
1696 const VkSparseMemoryBind* pBinds
1697}
1698
1699class VkSparseImageMemoryBindInfo {
1700 VkImage image
1701 u32 bindCount
1702 const VkSparseMemoryBind* pBinds
1703}
1704
1705class VkBindSparseInfo {
1706 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1707 const void* pNext
1708 u32 waitSemaphoreCount
1709 const VkSemaphore* pWaitSemaphores
1710 u32 numBufferBinds
1711 const VkSparseBufferMemoryBindInfo* pBufferBinds
1712 u32 numImageOpaqueBinds
1713 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1714 u32 numImageBinds
1715 const VkSparseImageMemoryBindInfo* pImageBinds
1716 u32 signalSemaphoreCount
1717 const VkSemaphore* pSignalSemaphores
1718}
1719
Jesse Hall65ab5522015-11-30 00:07:16 -08001720class VkImageSubresourceLayers {
1721 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001722 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001723 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001724 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001725}
1726
Jesse Halld27f6aa2015-08-15 17:58:48 -07001727class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001728 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001729 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001730 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001731 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001732 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1733}
1734
1735class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001736 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001737 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08001738 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001739 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07001740}
1741
1742class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001743 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001744 u32 bufferRowLength /// Specified in texels
1745 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001746 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001747 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1748 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1749}
1750
1751class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001752 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001753 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001754 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001755 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001756 VkExtent3D extent
1757}
1758
1759class VkShaderModuleCreateInfo {
1760 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1761 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001762 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001763 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08001764 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07001765}
1766
Jesse Halld27f6aa2015-08-15 17:58:48 -07001767class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08001768 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001769 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08001770 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001771 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
1772 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
1773}
1774
1775class VkDescriptorSetLayoutCreateInfo {
1776 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
1777 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001778 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001779 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08001780 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001781}
1782
Jesse Hall65ab5522015-11-30 00:07:16 -08001783class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001784 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08001785 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001786}
1787
1788class VkDescriptorPoolCreateInfo {
1789 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
1790 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08001791 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001792 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08001793 u32 poolSizeCount
1794 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001795}
1796
Jesse Hall3fbc8562015-11-29 22:10:52 -08001797class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001798 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08001799 const void* pNext /// Pointer to next structure
1800 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08001801 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001802 const VkDescriptorSetLayout* pSetLayouts
1803}
1804
Jesse Halld27f6aa2015-08-15 17:58:48 -07001805class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08001806 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07001807 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08001808 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07001809}
1810
1811class VkSpecializationInfo {
1812 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08001813 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07001814 platform.size_t dataSize /// Size in bytes of pData
1815 const void* pData /// Pointer to SpecConstant data
1816}
1817
1818class VkPipelineShaderStageCreateInfo {
1819 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
1820 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001821 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001822 VkShaderStageFlagBits stage
1823 VkShaderModule module
1824 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07001825 const VkSpecializationInfo* pSpecializationInfo
1826}
1827
1828class VkComputePipelineCreateInfo {
1829 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
1830 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001831 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001832 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001833 VkPipelineLayout layout /// Interface layout of the pipeline
1834 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
1835 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
1836}
1837
1838class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001839 u32 binding /// Vertex buffer binding id
1840 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08001841 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07001842}
1843
1844class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001845 u32 location /// location of the shader vertex attrib
1846 u32 binding /// Vertex buffer binding id
1847 VkFormat format /// format of source data
1848 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001849}
1850
1851class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001852 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
1853 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001854 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001855 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001856 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08001857 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001858 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1859}
1860
1861class VkPipelineInputAssemblyStateCreateInfo {
1862 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
1863 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001864 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001865 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001866 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001867}
1868
1869class VkPipelineTessellationStateCreateInfo {
1870 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
1871 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001872 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001873 u32 patchControlPoints
1874}
1875
1876class VkPipelineViewportStateCreateInfo {
1877 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
1878 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001879 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001880 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001881 const VkViewport* pViewports
1882 u32 scissorCount
1883 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07001884}
1885
Jesse Hall3fbc8562015-11-29 22:10:52 -08001886class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08001887 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001888 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001889 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001890 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001891 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001892 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08001893 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07001894 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001895 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08001896 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001897 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08001898 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001899 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001900}
1901
1902class VkPipelineMultisampleStateCreateInfo {
1903 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
1904 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001905 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001906 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001907 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001908 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001909 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08001910 VkBool32 alphaToCoverageEnable
1911 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001912}
1913
1914class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001915 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001916 VkBlendFactor srcColorBlendFactor
1917 VkBlendFactor dstColorBlendFactor
1918 VkBlendOp colorBlendOp
1919 VkBlendFactor srcAlphaBlendFactor
1920 VkBlendFactor dstAlphaBlendFactor
1921 VkBlendOp alphaBlendOp
1922 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001923}
1924
1925class VkPipelineColorBlendStateCreateInfo {
1926 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
1927 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001928 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001929 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001930 VkLogicOp logicOp
1931 u32 attachmentCount /// # of pAttachments
1932 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08001933 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07001934}
1935
1936class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08001937 VkStencilOp failOp
1938 VkStencilOp passOp
1939 VkStencilOp depthFailOp
1940 VkCompareOp compareOp
1941 u32 compareMask
1942 u32 writeMask
1943 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07001944}
1945
1946class VkPipelineDepthStencilStateCreateInfo {
1947 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
1948 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001949 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001950 VkBool32 depthTestEnable
1951 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001952 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001953 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
1954 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001955 VkStencilOpState front
1956 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001957 f32 minDepthBounds
1958 f32 maxDepthBounds
1959}
1960
1961class VkPipelineDynamicStateCreateInfo {
1962 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
1963 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001964 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001965 u32 dynamicStateCount
1966 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001967}
1968
1969class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08001970 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
1971 const void* pNext /// Pointer to next structure
1972 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001973 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08001974 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001975 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
1976 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
1977 const VkPipelineTessellationStateCreateInfo* pTessellationState
1978 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08001979 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07001980 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
1981 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
1982 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001983 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08001984 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001985 VkRenderPass renderPass
1986 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08001987 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
1988 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 -07001989}
1990
1991class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08001992 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
1993 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001994 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08001995 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
1996 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07001997}
1998
1999class VkPushConstantRange {
2000 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002001 u32 offset /// Start of the range, in bytes
2002 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002003}
2004
2005class VkPipelineLayoutCreateInfo {
2006 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2007 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002008 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002009 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002010 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2011 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2012 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2013}
2014
2015class VkSamplerCreateInfo {
2016 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2017 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002018 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002019 VkFilter magFilter /// Filter mode for magnification
2020 VkFilter minFilter /// Filter mode for minifiation
2021 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2022 VkSamplerAddressMode addressModeU
2023 VkSamplerAddressMode addressModeV
2024 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002025 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002026 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002027 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002028 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002029 VkCompareOp compareOp
2030 f32 minLod
2031 f32 maxLod
2032 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002033 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002034}
2035
Jesse Hall3fbc8562015-11-29 22:10:52 -08002036class VkCommandPoolCreateInfo {
2037 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002038 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002039 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002040 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002041}
2042
Jesse Hall3fbc8562015-11-29 22:10:52 -08002043class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002044 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002045 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002046 VkCommandPool commandPool
2047 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002048 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002049}
2050
Jesse Hall3dd678a2016-01-08 21:52:01 -08002051class VkCommandBufferInheritanceInfo {
2052 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002053 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002054 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002055 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002056 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002057 VkBool32 occlusionQueryEnable
2058 VkQueryControlFlags queryFlags
2059 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002060}
2061
Jesse Hall3dd678a2016-01-08 21:52:01 -08002062class VkCommandBufferBeginInfo {
2063 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2064 const void* pNext /// Pointer to next structure
2065 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2066 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2067}
2068
Jesse Halld27f6aa2015-08-15 17:58:48 -07002069class VkRenderPassBeginInfo {
2070 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2071 const void* pNext /// Pointer to next structure
2072 VkRenderPass renderPass
2073 VkFramebuffer framebuffer
2074 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002075 u32 clearValueCount
2076 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002077}
2078
2079@union
2080/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2081class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002082 f32[4] float32
2083 s32[4] int32
2084 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002085}
2086
2087class VkClearDepthStencilValue {
2088 f32 depth
2089 u32 stencil
2090}
2091
2092@union
2093/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2094class VkClearValue {
2095 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002096 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002097}
2098
Jesse Hallae38f732015-11-19 21:32:50 -08002099class VkClearAttachment {
2100 VkImageAspectFlags aspectMask
2101 u32 colorAttachment
2102 VkClearValue clearValue
2103}
2104
Jesse Halld27f6aa2015-08-15 17:58:48 -07002105class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002106 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002107 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002108 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002109 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2110 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2111 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2112 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2113 VkImageLayout initialLayout
2114 VkImageLayout finalLayout
2115}
2116
2117class VkAttachmentReference {
2118 u32 attachment
2119 VkImageLayout layout
2120}
2121
2122class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002123 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002124 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002125 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002126 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002127 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002128 const VkAttachmentReference* pColorAttachments
2129 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002130 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002131 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002132 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002133}
2134
2135class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002136 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002137 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002138 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002139 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002140 VkAccessFlags srcAccessMask
2141 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002142 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002143}
2144
2145class VkRenderPassCreateInfo {
2146 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2147 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002148 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002149 u32 attachmentCount
2150 const VkAttachmentDescription* pAttachments
2151 u32 subpassCount
2152 const VkSubpassDescription* pSubpasses
2153 u32 dependencyCount
2154 const VkSubpassDependency* pDependencies
2155}
2156
2157class VkEventCreateInfo {
2158 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2159 const void* pNext /// Pointer to next structure
2160 VkEventCreateFlags flags /// Event creation flags
2161}
2162
2163class VkFenceCreateInfo {
2164 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2165 const void* pNext /// Pointer to next structure
2166 VkFenceCreateFlags flags /// Fence creation flags
2167}
2168
2169class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002170 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2171 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2172 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2173 VkBool32 independentBlend /// blending operations are controlled per-attachment
2174 VkBool32 geometryShader /// geometry stage
2175 VkBool32 tessellationShader /// tessellation control and evaluation stage
2176 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002177 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002178 VkBool32 logicOp /// logic operations
2179 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002180 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002181 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002182 VkBool32 depthBiasClamp /// depth bias clamping
2183 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2184 VkBool32 depthBounds /// depth bounds test
2185 VkBool32 wideLines /// lines with width greater than 1
2186 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002187 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2188 VkBool32 multiViewport
2189 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002190 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2191 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2192 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002193 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002194 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002195 VkBool32 vertexPipelineStoresAndAtomics
2196 VkBool32 fragmentStoresAndAtomics
2197 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002198 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2199 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2200 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002201 VkBool32 shaderStorageImageReadWithoutFormat
2202 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002203 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2204 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2205 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2206 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2207 VkBool32 shaderClipDistance /// clip distance in shaders
2208 VkBool32 shaderCullDistance /// cull distance in shaders
2209 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2210 VkBool32 shaderInt64 /// 64-bit integers in shaders
2211 VkBool32 shaderInt16 /// 16-bit integers in shaders
2212 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002213 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002214 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2215 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2216 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2217 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2218 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2219 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2220 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2221 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2222 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002223 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002224 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002225}
2226
2227class VkPhysicalDeviceLimits {
2228 /// resource maximum sizes
2229 u32 maxImageDimension1D /// max 1D image dimension
2230 u32 maxImageDimension2D /// max 2D image dimension
2231 u32 maxImageDimension3D /// max 3D image dimension
2232 u32 maxImageDimensionCube /// max cubemap image dimension
2233 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002234 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002235 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2236 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002237 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2238 /// memory limits
2239 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002240 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002241 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2242 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002243 /// descriptor set limits
2244 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002245 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2246 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2247 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2248 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2249 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002250 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002251 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002252 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2253 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002254 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002255 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002256 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002257 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2258 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002259 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002260 /// vertex stage limits
2261 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002262 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002263 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2264 u32 maxVertexInputBindingStride /// max vertex input binding stride
2265 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2266 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002267 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002268 u32 maxTessellationPatchSize /// max patch size (vertices)
2269 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2270 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2271 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2272 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2273 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2274 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002275 /// geometry stage limits
2276 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2277 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2278 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2279 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2280 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2281 /// fragment stage limits
2282 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002283 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002284 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002285 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2286 /// compute stage limits
2287 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2288 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2289 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2290 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2291
2292 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2293 u32 subTexelPrecisionBits /// num bits of subtexel precision
2294 u32 mipmapPrecisionBits /// num bits of mipmap precision
2295
2296 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002297 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002298
2299 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2300 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2301
2302 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002303 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2304 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2305 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2306
Jesse Halldc6d36c2015-11-29 19:12:15 -08002307 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2308 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2309 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2310 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002311
Jesse Hallfbf97b02015-11-20 14:17:03 -08002312 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002313 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002314 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002315 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2316 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2317 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2318 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2319
2320 u32 maxFramebufferWidth /// max width for a framebuffer
2321 u32 maxFramebufferHeight /// max height for a framebuffer
2322 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002323 VkSampleCountFlags framebufferColorSampleCounts
2324 VkSampleCountFlags framebufferDepthSampleCounts
2325 VkSampleCountFlags framebufferStencilSampleCounts
2326 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002327 u32 maxColorAttachments /// max num of framebuffer color attachments
2328
Jesse Hall091ed9e2015-11-30 00:55:29 -08002329 VkSampleCountFlags sampledImageColorSampleCounts
2330 VkSampleCountFlags sampledImageIntegerSampleCounts
2331 VkSampleCountFlags sampledImageDepthSampleCounts
2332 VkSampleCountFlags sampledImageStencilSampleCounts
2333 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002334 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002335 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002336
Jesse Halla9bb62b2015-11-21 19:31:56 -08002337 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002338
2339 u32 maxClipDistances /// max number of clip distances
2340 u32 maxCullDistances /// max number of cull distances
2341 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2342
Jesse Hallfbf97b02015-11-20 14:17:03 -08002343 u32 discreteQueuePriorities
2344
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002345 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2346 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002347 f32 pointSizeGranularity /// granularity of supported point sizes
2348 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002349 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002350 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002351
Jesse Hall65ab5522015-11-30 00:07:16 -08002352 VkDeviceSize optimalBufferCopyOffsetAlignment
2353 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002354 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002355}
2356
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002357class VkPhysicalDeviceSparseProperties {
2358 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 -08002359 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 -07002360 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2361 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 -07002362 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
2363}
2364
Jesse Halld27f6aa2015-08-15 17:58:48 -07002365class VkSemaphoreCreateInfo {
2366 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2367 const void* pNext /// Pointer to next structure
2368 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2369}
2370
2371class VkQueryPoolCreateInfo {
2372 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2373 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002374 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002375 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002376 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002377 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2378}
2379
2380class VkFramebufferCreateInfo {
2381 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2382 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002383 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002384 VkRenderPass renderPass
2385 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002386 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002387 u32 width
2388 u32 height
2389 u32 layers
2390}
2391
Jesse Hall3fbc8562015-11-29 22:10:52 -08002392class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002393 u32 vertexCount
2394 u32 instanceCount
2395 u32 firstVertex
2396 u32 firstInstance
2397}
2398
Jesse Hall3fbc8562015-11-29 22:10:52 -08002399class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002400 u32 indexCount
2401 u32 instanceCount
2402 u32 firstIndex
2403 s32 vertexOffset
2404 u32 firstInstance
2405}
2406
Jesse Hall3fbc8562015-11-29 22:10:52 -08002407class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002408 u32 x
2409 u32 y
2410 u32 z
2411}
2412
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002413@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002414class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002415 u32 minImageCount
2416 u32 maxImageCount
2417 VkExtent2D currentExtent
2418 VkExtent2D minImageExtent
2419 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002420 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002421 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002422 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002423 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002424 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002425}
2426
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002427@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002428class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002429 VkFormat format
2430 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002431}
2432
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002433@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002434class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002435 VkStructureType sType
2436 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002437 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002438 VkSurfaceKHR surface
2439 u32 minImageCount
2440 VkFormat imageFormat
2441 VkColorSpaceKHR imageColorSpace
2442 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002443 u32 imageArrayLayers
2444 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002445 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002446 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002447 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002448 VkSurfaceTransformFlagBitsKHR preTransform
2449 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002450 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002451 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002452 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002453}
2454
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002455@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002456class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002457 VkStructureType sType
2458 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002459 u32 waitSemaphoreCount
2460 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002461 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002462 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002463 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002464 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002465}
2466
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002467@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002468class VkDisplayPropertiesKHR {
2469 VkDisplayKHR display
2470 const char* displayName
2471 VkExtent2D physicalDimensions
2472 VkExtent2D physicalResolution
2473 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002474 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002475 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002476}
2477
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002478@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002479class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002480 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002481 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002482}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002483
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002484@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002485class VkDisplayModePropertiesKHR {
2486 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002487 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002488}
2489
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002490@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002491class VkDisplayModeCreateInfoKHR {
2492 VkStructureType sType
2493 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002494 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002495 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002496}
2497
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002498@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002499class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002500 VkDisplayKHR currentDisplay
2501 u32 currentStackIndex
2502}
2503
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002504@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002505class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002506 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2507 VkOffset2D minSrcPosition
2508 VkOffset2D maxSrcPosition
2509 VkExtent2D minSrcExtent
2510 VkExtent2D maxSrcExtent
2511 VkOffset2D minDstPosition
2512 VkOffset2D maxDstPosition
2513 VkExtent2D minDstExtent
2514 VkExtent2D maxDstExtent
2515}
2516
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002517@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002518class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002519 VkStructureType sType
2520 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002521 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002522 VkDisplayModeKHR displayMode
2523 u32 planeIndex
2524 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002525 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002526 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002527 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2528 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002529}
2530
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002531@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002532class VkDisplayPresentInfoKHR {
2533 VkStructureType sType
2534 const void* pNext
2535 VkRect2D srcRect
2536 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002537 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002538}
2539
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002540@extension("VK_KHR_xlib_surface")
2541class VkXlibSurfaceCreateInfoKHR {
2542 VkStructureType sType
2543 const void* pNext
2544 VkXlibSurfaceCreateFlagsKHR flags
2545 platform.Display* dpy
2546 platform.Window window
2547}
2548
2549@extension("VK_KHR_xcb_surface")
2550class VkXcbSurfaceCreateInfoKHR {
2551 VkStructureType sType
2552 const void* pNext
2553 VkXcbSurfaceCreateFlagsKHR flags
2554 platform.xcb_connection_t* connection
2555 platform.xcb_window_t window
2556}
2557
2558@extension("VK_KHR_wayland_surface")
2559class VkWaylandSurfaceCreateInfoKHR {
2560 VkStructureType sType
2561 const void* pNext
2562 VkWaylandSurfaceCreateFlagsKHR flags
2563 platform.wl_display* display
2564 platform.wl_surface* surface
2565}
2566
2567@extension("VK_KHR_mir_surface")
2568class VkMirSurfaceCreateInfoKHR {
2569 VkStructureType sType
2570 const void* pNext
2571 VkMirSurfaceCreateFlagsKHR flags
2572 platform.MirConnection* connection
2573 platform.MirSurface* mirSurface
2574}
2575
2576@extension("VK_KHR_android_surface")
2577class VkAndroidSurfaceCreateInfoKHR {
2578 VkStructureType sType
2579 const void* pNext
2580 VkAndroidSurfaceCreateFlagsKHR flags
2581 platform.ANativeWindow* window
2582}
2583
2584@extension("VK_KHR_win32_surface")
2585class VkWin32SurfaceCreateInfoKHR {
2586 VkStructureType sType
2587 const void* pNext
2588 VkWin32SurfaceCreateFlagsKHR flags
2589 platform.HINSTANCE hinstance
2590 platform.HWND hwnd
2591}
2592
Jesse Hall715b86a2016-01-16 16:34:29 -08002593@extension("VK_EXT_debug_report")
2594class VkDebugReportCallbackCreateInfoEXT {
2595 VkStructureType sType
2596 const void* pNext
2597 VkDebugReportFlagsEXT flags
2598 PFN_vkDebugReportCallbackEXT pfnCallback
2599 void* pUserData
2600}
2601
Jesse Hall1356b0d2015-11-23 17:24:58 -08002602
Jesse Halld27f6aa2015-08-15 17:58:48 -07002603////////////////
2604// Commands //
2605////////////////
2606
2607// Function pointers. TODO: add support for function pointers.
2608
2609@external type void* PFN_vkVoidFunction
2610@pfn cmd void vkVoidFunction() {
2611}
2612
Jesse Hall3fbc8562015-11-29 22:10:52 -08002613@external type void* PFN_vkAllocationFunction
2614@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002615 void* pUserData,
2616 platform.size_t size,
2617 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002618 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002619 return ?
2620}
2621
Jesse Hall3fbc8562015-11-29 22:10:52 -08002622@external type void* PFN_vkReallocationFunction
2623@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002624 void* pUserData,
2625 void* pOriginal,
2626 platform.size_t size,
2627 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002628 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002629 return ?
2630}
2631
2632@external type void* PFN_vkFreeFunction
2633@pfn cmd void vkFreeFunction(
2634 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002635 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002636}
2637
Jesse Hall3fbc8562015-11-29 22:10:52 -08002638@external type void* PFN_vkInternalAllocationNotification
2639@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002640 void* pUserData,
2641 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002642 VkInternalAllocationType allocationType,
2643 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002644}
2645
2646@external type void* PFN_vkInternalFreeNotification
2647@pfn cmd void vkInternalFreeNotification(
2648 void* pUserData,
2649 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002650 VkInternalAllocationType allocationType,
2651 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002652}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002653
2654// Global functions
2655
2656@threadSafety("system")
2657cmd VkResult vkCreateInstance(
2658 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002659 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002660 VkInstance* pInstance) {
2661 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
2662
2663 instance := ?
2664 pInstance[0] = instance
2665 State.Instances[instance] = new!InstanceObject()
2666
Jesse Hall3dd678a2016-01-08 21:52:01 -08002667 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
2668 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07002669
2670 return ?
2671}
2672
2673@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002674cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002675 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002676 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002677 instanceObject := GetInstance(instance)
2678
2679 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002680}
2681
2682@threadSafety("system")
2683cmd VkResult vkEnumeratePhysicalDevices(
2684 VkInstance instance,
2685 u32* pPhysicalDeviceCount,
2686 VkPhysicalDevice* pPhysicalDevices) {
2687 instanceObject := GetInstance(instance)
2688
2689 physicalDeviceCount := as!u32(?)
2690 pPhysicalDeviceCount[0] = physicalDeviceCount
2691 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
2692
2693 for i in (0 .. physicalDeviceCount) {
2694 physicalDevice := ?
2695 physicalDevices[i] = physicalDevice
2696 if !(physicalDevice in State.PhysicalDevices) {
2697 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
2698 }
2699 }
2700
2701 return ?
2702}
2703
2704cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
2705 VkDevice device,
2706 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002707 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002708 device := GetDevice(device)
2709 }
2710
2711 return ?
2712}
2713
2714cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
2715 VkInstance instance,
2716 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002717 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002718 instanceObject := GetInstance(instance)
2719 }
2720
2721 return ?
2722}
2723
Jesse Hall606a54e2015-11-19 22:17:28 -08002724cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002725 VkPhysicalDevice physicalDevice,
2726 VkPhysicalDeviceProperties* pProperties) {
2727 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2728
2729 properties := ?
2730 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002731}
2732
Jesse Hall606a54e2015-11-19 22:17:28 -08002733cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002734 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002735 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002736 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002737 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002738 // TODO: Figure out how to express fetch-count-or-properties
2739 // This version fails 'apic validate' with 'fence not allowed in
2740 // *semantic.Branch'. Other attempts have failed with the same or other
2741 // errors.
2742 // if pQueueFamilyProperties != null {
2743 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
2744 // for i in (0 .. pCount[0]) {
2745 // queueProperties := as!VkQueueFamilyProperties(?)
2746 // queuesProperties[i] = queueProperties
2747 // }
2748 // } else {
2749 // count := ?
2750 // pCount[0] = count
2751 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002752}
2753
Jesse Hall606a54e2015-11-19 22:17:28 -08002754cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002755 VkPhysicalDevice physicalDevice,
2756 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
2757 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2758
2759 memoryProperties := ?
2760 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002761}
2762
Jesse Hall606a54e2015-11-19 22:17:28 -08002763cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002764 VkPhysicalDevice physicalDevice,
2765 VkPhysicalDeviceFeatures* pFeatures) {
2766 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2767
2768 features := ?
2769 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07002770}
2771
Jesse Hall606a54e2015-11-19 22:17:28 -08002772cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002773 VkPhysicalDevice physicalDevice,
2774 VkFormat format,
2775 VkFormatProperties* pFormatProperties) {
2776 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2777
2778 formatProperties := ?
2779 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002780}
2781
Jesse Halla9e57032015-11-30 01:03:10 -08002782cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002783 VkPhysicalDevice physicalDevice,
2784 VkFormat format,
2785 VkImageType type,
2786 VkImageTiling tiling,
2787 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002788 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002789 VkImageFormatProperties* pImageFormatProperties) {
2790 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2791
2792 imageFormatProperties := ?
2793 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08002794
2795 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07002796}
2797
Jesse Halld27f6aa2015-08-15 17:58:48 -07002798
2799// Device functions
2800
2801@threadSafety("system")
2802cmd VkResult vkCreateDevice(
2803 VkPhysicalDevice physicalDevice,
2804 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002805 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002806 VkDevice* pDevice) {
2807 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
2808 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2809
2810 device := ?
2811 pDevice[0] = device
2812 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
2813
2814 return ?
2815}
2816
2817@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002818cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002819 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002820 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002821 deviceObject := GetDevice(device)
2822
2823 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002824}
2825
2826
2827// Extension discovery functions
2828
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002829cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002830 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002831 VkLayerProperties* pProperties) {
2832 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002833 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002834
2835 properties := pProperties[0:count]
2836 for i in (0 .. count) {
2837 property := ?
2838 properties[i] = property
2839 }
2840
2841 return ?
2842}
2843
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002844cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002845 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002846 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002847 VkExtensionProperties* pProperties) {
2848 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002849 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002850
2851 properties := pProperties[0:count]
2852 for i in (0 .. count) {
2853 property := ?
2854 properties[i] = property
2855 }
2856
2857 return ?
2858}
2859
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002860cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002861 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002862 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002863 VkLayerProperties* pProperties) {
2864 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2865 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002866 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002867
2868 properties := pProperties[0:count]
2869 for i in (0 .. count) {
2870 property := ?
2871 properties[i] = property
2872 }
2873
2874 return ?
2875}
2876
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002877cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002878 VkPhysicalDevice physicalDevice,
2879 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002880 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002881 VkExtensionProperties* pProperties) {
2882 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2883
2884 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002885 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002886
2887 properties := pProperties[0:count]
2888 for i in (0 .. count) {
2889 property := ?
2890 properties[i] = property
2891 }
2892
2893 return ?
2894}
2895
2896
2897// Queue functions
2898
2899@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08002900cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002901 VkDevice device,
2902 u32 queueFamilyIndex,
2903 u32 queueIndex,
2904 VkQueue* pQueue) {
2905 deviceObject := GetDevice(device)
2906
2907 queue := ?
2908 pQueue[0] = queue
2909
2910 if !(queue in State.Queues) {
2911 State.Queues[queue] = new!QueueObject(device: device)
2912 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002913}
2914
2915@threadSafety("app")
2916cmd VkResult vkQueueSubmit(
2917 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08002918 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08002919 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002920 VkFence fence) {
2921 queueObject := GetQueue(queue)
2922
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002923 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002924 fenceObject := GetFence(fence)
2925 assert(fenceObject.device == queueObject.device)
2926 }
2927
Jesse Hall3fbc8562015-11-29 22:10:52 -08002928 // commandBuffers := pcommandBuffers[0:commandBufferCount]
2929 // for i in (0 .. commandBufferCount) {
2930 // commandBuffer := commandBuffers[i]
2931 // commandBufferObject := GetCommandBuffer(commandBuffer)
2932 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08002933 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08002934 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
2935 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08002936 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002937
2938 return ?
2939}
2940
2941@threadSafety("system")
2942cmd VkResult vkQueueWaitIdle(
2943 VkQueue queue) {
2944 queueObject := GetQueue(queue)
2945
2946 return ?
2947}
2948
2949@threadSafety("system")
2950cmd VkResult vkDeviceWaitIdle(
2951 VkDevice device) {
2952 deviceObject := GetDevice(device)
2953
2954 return ?
2955}
2956
2957
2958// Memory functions
2959
2960@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002961cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002962 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002963 const VkMemoryAllocateInfo* pAllocateInfo,
2964 const VkAllocationCallbacks* pAllocator,
2965 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002966 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002967 deviceObject := GetDevice(device)
2968
Jesse Hall3fbc8562015-11-29 22:10:52 -08002969 memory := ?
2970 pMemory[0] = memory
2971 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002972 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002973 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002974
2975 return ?
2976}
2977
2978@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002979cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002980 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002981 VkDeviceMemory memory,
2982 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002983 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002984 memoryObject := GetDeviceMemory(memory)
2985 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002986
2987 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08002988 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002989 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002990 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
2991 "vkFreeMemory: commandBuffers still bound")
2992 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002993}
2994
2995@threadSafety("app")
2996cmd VkResult vkMapMemory(
2997 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002998 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002999 VkDeviceSize offset,
3000 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003001 VkMemoryMapFlags flags,
3002 void** ppData) {
3003 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003004 memoryObject := GetDeviceMemory(memory)
3005 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003006
3007 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003008 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003009
3010 return ?
3011}
3012
3013@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003014cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003015 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003016 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003017 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003018 memoryObject := GetDeviceMemory(memory)
3019 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003020}
3021
3022cmd VkResult vkFlushMappedMemoryRanges(
3023 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003024 u32 memoryRangeCount
3025 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003026 deviceObject := GetDevice(device)
3027
Jesse Hall3fbc8562015-11-29 22:10:52 -08003028 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3029 for i in (0 .. memoryRangeCount) {
3030 memoryRange := memoryRanges[i]
3031 memoryObject := GetDeviceMemory(memoryRange.memory)
3032 assert(memoryObject.device == device)
3033 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003034 }
3035
3036 return ?
3037}
3038
3039cmd VkResult vkInvalidateMappedMemoryRanges(
3040 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003041 u32 memoryRangeCount,
3042 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003043 deviceObject := GetDevice(device)
3044
Jesse Hall3fbc8562015-11-29 22:10:52 -08003045 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3046 for i in (0 .. memoryRangeCount) {
3047 memoryRange := memoryRanges[i]
3048 memoryObject := GetDeviceMemory(memoryRange.memory)
3049 assert(memoryObject.device == device)
3050 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003051 }
3052
3053 return ?
3054}
3055
3056
3057// Memory management API functions
3058
Jesse Hall606a54e2015-11-19 22:17:28 -08003059cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003060 VkDevice device,
3061 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003062 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003063 deviceObject := GetDevice(device)
3064
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003065 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003066 memoryObject := GetDeviceMemory(memory)
3067 assert(memoryObject.device == device)
3068 }
3069
3070 committedMemoryInBytes := ?
3071 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003072}
3073
Jesse Hall606a54e2015-11-19 22:17:28 -08003074cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003075 VkDevice device,
3076 VkBuffer buffer,
3077 VkMemoryRequirements* pMemoryRequirements) {
3078 deviceObject := GetDevice(device)
3079 bufferObject := GetBuffer(buffer)
3080 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003081}
3082
3083cmd VkResult vkBindBufferMemory(
3084 VkDevice device,
3085 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003086 VkDeviceMemory memory,
3087 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003088 deviceObject := GetDevice(device)
3089 bufferObject := GetBuffer(buffer)
3090 assert(bufferObject.device == device)
3091
3092 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003093 if bufferObject.memory != NULL_HANDLE {
3094 memoryObject := GetDeviceMemory(bufferObject.memory)
3095 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003096 }
3097
3098 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003099 if memory != NULL_HANDLE {
3100 memoryObject := GetDeviceMemory(memory)
3101 assert(memoryObject.device == device)
3102 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003103 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003104 bufferObject.memory = memory
3105 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003106
3107 return ?
3108}
3109
Jesse Hall606a54e2015-11-19 22:17:28 -08003110cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003111 VkDevice device,
3112 VkImage image,
3113 VkMemoryRequirements* pMemoryRequirements) {
3114 deviceObject := GetDevice(device)
3115 imageObject := GetImage(image)
3116 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003117}
3118
3119cmd VkResult vkBindImageMemory(
3120 VkDevice device,
3121 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003122 VkDeviceMemory memory,
3123 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003124 deviceObject := GetDevice(device)
3125 imageObject := GetImage(image)
3126 assert(imageObject.device == device)
3127
3128 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003129 if imageObject.memory != NULL_HANDLE {
3130 memoryObject := GetDeviceMemory(imageObject.memory)
3131 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003132 }
3133
3134 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003135 if memory != NULL_HANDLE {
3136 memoryObject := GetDeviceMemory(memory)
3137 assert(memoryObject.device == device)
3138 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003139 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003140 imageObject.memory = memory
3141 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003142
3143 return ?
3144}
3145
Jesse Hall606a54e2015-11-19 22:17:28 -08003146cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003147 VkDevice device,
3148 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003149 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003150 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3151 deviceObject := GetDevice(device)
3152 imageObject := GetImage(image)
3153 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003154}
3155
Jesse Hall606a54e2015-11-19 22:17:28 -08003156cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003157 VkPhysicalDevice physicalDevice,
3158 VkFormat format,
3159 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003160 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003161 VkImageUsageFlags usage,
3162 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003163 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003164 VkSparseImageFormatProperties* pProperties) {
3165 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003166}
3167
Jesse Halla6429252015-11-29 18:59:42 -08003168cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003169 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003170 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003171 const VkBindSparseInfo* pBindInfo,
3172 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003173 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003174
3175 return ?
3176}
3177
3178
3179// Fence functions
3180
3181@threadSafety("system")
3182cmd VkResult vkCreateFence(
3183 VkDevice device,
3184 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003185 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003186 VkFence* pFence) {
3187 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3188 deviceObject := GetDevice(device)
3189
3190 fence := ?
3191 pFence[0] = fence
3192 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003193 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003194
3195 return ?
3196}
3197
3198@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003199cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003200 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003201 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003202 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003203 deviceObject := GetDevice(device)
3204 fenceObject := GetFence(fence)
3205 assert(fenceObject.device == device)
3206
3207 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003208}
3209
3210@threadSafety("system")
3211cmd VkResult vkResetFences(
3212 VkDevice device,
3213 u32 fenceCount,
3214 const VkFence* pFences) {
3215 deviceObject := GetDevice(device)
3216
3217 fences := pFences[0:fenceCount]
3218 for i in (0 .. fenceCount) {
3219 fence := fences[i]
3220 fenceObject := GetFence(fence)
3221 assert(fenceObject.device == device)
3222 fenceObject.signaled = false
3223 }
3224
3225 return ?
3226}
3227
3228@threadSafety("system")
3229cmd VkResult vkGetFenceStatus(
3230 VkDevice device,
3231 VkFence fence) {
3232 deviceObject := GetDevice(device)
3233 fenceObject := GetFence(fence)
3234 assert(fenceObject.device == device)
3235
3236 return ?
3237}
3238
3239@threadSafety("system")
3240cmd VkResult vkWaitForFences(
3241 VkDevice device,
3242 u32 fenceCount,
3243 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003244 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003245 u64 timeout) { /// timeout in nanoseconds
3246 deviceObject := GetDevice(device)
3247
3248 fences := pFences[0:fenceCount]
3249 for i in (0 .. fenceCount) {
3250 fence := fences[i]
3251 fenceObject := GetFence(fence)
3252 assert(fenceObject.device == device)
3253 }
3254
3255 return ?
3256}
3257
3258
3259// Queue semaphore functions
3260
3261@threadSafety("system")
3262cmd VkResult vkCreateSemaphore(
3263 VkDevice device,
3264 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003265 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003266 VkSemaphore* pSemaphore) {
3267 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3268 deviceObject := GetDevice(device)
3269
3270 semaphore := ?
3271 pSemaphore[0] = semaphore
3272 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3273
3274 return ?
3275}
3276
3277@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003278cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003279 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003280 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003281 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003282 deviceObject := GetDevice(device)
3283 semaphoreObject := GetSemaphore(semaphore)
3284 assert(semaphoreObject.device == device)
3285
3286 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003287}
3288
Jesse Halld27f6aa2015-08-15 17:58:48 -07003289
3290// Event functions
3291
3292@threadSafety("system")
3293cmd VkResult vkCreateEvent(
3294 VkDevice device,
3295 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003296 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003297 VkEvent* pEvent) {
3298 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3299 deviceObject := GetDevice(device)
3300
3301 event := ?
3302 pEvent[0] = event
3303 State.Events[event] = new!EventObject(device: device)
3304
3305 return ?
3306}
3307
3308@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003309cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003310 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003311 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003312 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003313 deviceObject := GetDevice(device)
3314 eventObject := GetEvent(event)
3315 assert(eventObject.device == device)
3316
3317 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003318}
3319
3320@threadSafety("system")
3321cmd VkResult vkGetEventStatus(
3322 VkDevice device,
3323 VkEvent event) {
3324 deviceObject := GetDevice(device)
3325 eventObject := GetEvent(event)
3326 assert(eventObject.device == device)
3327
3328 return ?
3329}
3330
3331@threadSafety("system")
3332cmd VkResult vkSetEvent(
3333 VkDevice device,
3334 VkEvent event) {
3335 deviceObject := GetDevice(device)
3336 eventObject := GetEvent(event)
3337 assert(eventObject.device == device)
3338
3339 return ?
3340}
3341
3342@threadSafety("system")
3343cmd VkResult vkResetEvent(
3344 VkDevice device,
3345 VkEvent event) {
3346 deviceObject := GetDevice(device)
3347 eventObject := GetEvent(event)
3348 assert(eventObject.device == device)
3349
3350 return ?
3351}
3352
3353
3354// Query functions
3355
3356@threadSafety("system")
3357cmd VkResult vkCreateQueryPool(
3358 VkDevice device,
3359 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003360 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003361 VkQueryPool* pQueryPool) {
3362 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3363 deviceObject := GetDevice(device)
3364
3365 queryPool := ?
3366 pQueryPool[0] = queryPool
3367 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3368
3369 return ?
3370}
3371
3372@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003373cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003374 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003375 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003376 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003377 deviceObject := GetDevice(device)
3378 queryPoolObject := GetQueryPool(queryPool)
3379 assert(queryPoolObject.device == device)
3380
3381 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003382}
3383
3384@threadSafety("system")
3385cmd VkResult vkGetQueryPoolResults(
3386 VkDevice device,
3387 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003388 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003389 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003390 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003391 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003392 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003393 VkQueryResultFlags flags) {
3394 deviceObject := GetDevice(device)
3395 queryPoolObject := GetQueryPool(queryPool)
3396 assert(queryPoolObject.device == device)
3397
Jesse Halld27f6aa2015-08-15 17:58:48 -07003398 data := pData[0:dataSize]
3399
3400 return ?
3401}
3402
3403// Buffer functions
3404
3405@threadSafety("system")
3406cmd VkResult vkCreateBuffer(
3407 VkDevice device,
3408 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003409 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003410 VkBuffer* pBuffer) {
3411 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3412 deviceObject := GetDevice(device)
3413
3414 buffer := ?
3415 pBuffer[0] = buffer
3416 State.Buffers[buffer] = new!BufferObject(device: device)
3417
3418 return ?
3419}
3420
3421@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003422cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003423 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003424 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003425 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003426 deviceObject := GetDevice(device)
3427 bufferObject := GetBuffer(buffer)
3428 assert(bufferObject.device == device)
3429
Jesse Hall3fbc8562015-11-29 22:10:52 -08003430 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003431 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003432}
3433
3434
3435// Buffer view functions
3436
3437@threadSafety("system")
3438cmd VkResult vkCreateBufferView(
3439 VkDevice device,
3440 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003441 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003442 VkBufferView* pView) {
3443 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3444 deviceObject := GetDevice(device)
3445
3446 bufferObject := GetBuffer(pCreateInfo.buffer)
3447 assert(bufferObject.device == device)
3448
3449 view := ?
3450 pView[0] = view
3451 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3452
3453 return ?
3454}
3455
3456@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003457cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003458 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003459 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003460 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003461 deviceObject := GetDevice(device)
3462 bufferViewObject := GetBufferView(bufferView)
3463 assert(bufferViewObject.device == device)
3464
3465 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003466}
3467
3468
3469// Image functions
3470
3471@threadSafety("system")
3472cmd VkResult vkCreateImage(
3473 VkDevice device,
3474 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003475 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003476 VkImage* pImage) {
3477 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3478 deviceObject := GetDevice(device)
3479
3480 image := ?
3481 pImage[0] = image
3482 State.Images[image] = new!ImageObject(device: device)
3483
3484 return ?
3485}
3486
3487@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003488cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003489 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003490 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003491 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003492 deviceObject := GetDevice(device)
3493 imageObject := GetImage(image)
3494 assert(imageObject.device == device)
3495
Jesse Hall3fbc8562015-11-29 22:10:52 -08003496 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003497 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003498}
3499
Jesse Hall606a54e2015-11-19 22:17:28 -08003500cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003501 VkDevice device,
3502 VkImage image,
3503 const VkImageSubresource* pSubresource,
3504 VkSubresourceLayout* pLayout) {
3505 deviceObject := GetDevice(device)
3506 imageObject := GetImage(image)
3507 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003508}
3509
3510
3511// Image view functions
3512
3513@threadSafety("system")
3514cmd VkResult vkCreateImageView(
3515 VkDevice device,
3516 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003517 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003518 VkImageView* pView) {
3519 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
3520 deviceObject := GetDevice(device)
3521
3522 imageObject := GetImage(pCreateInfo.image)
3523 assert(imageObject.device == device)
3524
3525 view := ?
3526 pView[0] = view
3527 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
3528
3529 return ?
3530}
3531
3532@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003533cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003534 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003535 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003536 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003537 deviceObject := GetDevice(device)
3538 imageViewObject := GetImageView(imageView)
3539 assert(imageViewObject.device == device)
3540
3541 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003542}
3543
3544
3545// Shader functions
3546
3547cmd VkResult vkCreateShaderModule(
3548 VkDevice device,
3549 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003550 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003551 VkShaderModule* pShaderModule) {
3552 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
3553 deviceObject := GetDevice(device)
3554
3555 shaderModule := ?
3556 pShaderModule[0] = shaderModule
3557 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
3558
3559 return ?
3560}
3561
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003562cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003563 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003564 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003565 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003566 deviceObject := GetDevice(device)
3567 shaderModuleObject := GetShaderModule(shaderModule)
3568 assert(shaderModuleObject.device == device)
3569
3570 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003571}
3572
Jesse Halld27f6aa2015-08-15 17:58:48 -07003573
3574// Pipeline functions
3575
3576cmd VkResult vkCreatePipelineCache(
3577 VkDevice device,
3578 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003579 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003580 VkPipelineCache* pPipelineCache) {
3581 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
3582 deviceObject := GetDevice(device)
3583
3584 pipelineCache := ?
3585 pPipelineCache[0] = pipelineCache
3586 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
3587
3588 return ?
3589}
3590
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003591cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003592 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003593 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003594 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003595 deviceObject := GetDevice(device)
3596 pipelineCacheObject := GetPipelineCache(pipelineCache)
3597 assert(pipelineCacheObject.device == device)
3598
3599 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003600}
3601
Jesse Halld27f6aa2015-08-15 17:58:48 -07003602cmd VkResult vkGetPipelineCacheData(
3603 VkDevice device,
3604 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003605 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003606 void* pData) {
3607 deviceObject := GetDevice(device)
3608 pipelineCacheObject := GetPipelineCache(pipelineCache)
3609 assert(pipelineCacheObject.device == device)
3610
3611 return ?
3612}
3613
3614cmd VkResult vkMergePipelineCaches(
3615 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003616 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003617 u32 srcCacheCount,
3618 const VkPipelineCache* pSrcCaches) {
3619 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003620 dstCacheObject := GetPipelineCache(dstCache)
3621 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003622
3623 srcCaches := pSrcCaches[0:srcCacheCount]
3624 for i in (0 .. srcCacheCount) {
3625 srcCache := srcCaches[i]
3626 srcCacheObject := GetPipelineCache(srcCache)
3627 assert(srcCacheObject.device == device)
3628 }
3629
3630 return ?
3631}
3632
3633cmd VkResult vkCreateGraphicsPipelines(
3634 VkDevice device,
3635 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003636 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003637 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003638 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003639 VkPipeline* pPipelines) {
3640 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003641 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003642 pipelineCacheObject := GetPipelineCache(pipelineCache)
3643 assert(pipelineCacheObject.device == device)
3644 }
3645
Jesse Hall03b6fe12015-11-24 12:44:21 -08003646 createInfos := pCreateInfos[0:createInfoCount]
3647 pipelines := pPipelines[0:createInfoCount]
3648 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003649 pipeline := ?
3650 pipelines[i] = pipeline
3651 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3652 }
3653
3654 return ?
3655}
3656
3657cmd VkResult vkCreateComputePipelines(
3658 VkDevice device,
3659 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003660 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003661 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003662 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003663 VkPipeline* pPipelines) {
3664 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003665 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003666 pipelineCacheObject := GetPipelineCache(pipelineCache)
3667 assert(pipelineCacheObject.device == device)
3668 }
3669
Jesse Hall03b6fe12015-11-24 12:44:21 -08003670 createInfos := pCreateInfos[0:createInfoCount]
3671 pipelines := pPipelines[0:createInfoCount]
3672 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003673 pipeline := ?
3674 pipelines[i] = pipeline
3675 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3676 }
3677
3678 return ?
3679}
3680
3681@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003682cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003683 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003684 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003685 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003686 deviceObject := GetDevice(device)
3687 pipelineObjects := GetPipeline(pipeline)
3688 assert(pipelineObjects.device == device)
3689
3690 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003691}
3692
3693
3694// Pipeline layout functions
3695
3696@threadSafety("system")
3697cmd VkResult vkCreatePipelineLayout(
3698 VkDevice device,
3699 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003700 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003701 VkPipelineLayout* pPipelineLayout) {
3702 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
3703 deviceObject := GetDevice(device)
3704
3705 pipelineLayout := ?
3706 pPipelineLayout[0] = pipelineLayout
3707 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
3708
3709 return ?
3710}
3711
3712@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003713cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003714 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003715 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003716 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003717 deviceObject := GetDevice(device)
3718 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
3719 assert(pipelineLayoutObjects.device == device)
3720
3721 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003722}
3723
3724
3725// Sampler functions
3726
3727@threadSafety("system")
3728cmd VkResult vkCreateSampler(
3729 VkDevice device,
3730 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003731 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003732 VkSampler* pSampler) {
3733 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
3734 deviceObject := GetDevice(device)
3735
3736 sampler := ?
3737 pSampler[0] = sampler
3738 State.Samplers[sampler] = new!SamplerObject(device: device)
3739
3740 return ?
3741}
3742
3743@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003744cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003745 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003746 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003747 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003748 deviceObject := GetDevice(device)
3749 samplerObject := GetSampler(sampler)
3750 assert(samplerObject.device == device)
3751
3752 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003753}
3754
3755
3756// Descriptor set functions
3757
3758@threadSafety("system")
3759cmd VkResult vkCreateDescriptorSetLayout(
3760 VkDevice device,
3761 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003762 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003763 VkDescriptorSetLayout* pSetLayout) {
3764 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
3765 deviceObject := GetDevice(device)
3766
3767 setLayout := ?
3768 pSetLayout[0] = setLayout
3769 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
3770
3771 return ?
3772}
3773
3774@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003775cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003776 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003777 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003778 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003779 deviceObject := GetDevice(device)
3780 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
3781 assert(descriptorSetLayoutObject.device == device)
3782
3783 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003784}
3785
3786@threadSafety("system")
3787cmd VkResult vkCreateDescriptorPool(
3788 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003789 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003790 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003791 VkDescriptorPool* pDescriptorPool) {
3792 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
3793 deviceObject := GetDevice(device)
3794
3795 descriptorPool := ?
3796 pDescriptorPool[0] = descriptorPool
3797 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
3798
3799 return ?
3800}
3801
3802@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003803cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003804 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003805 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003806 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003807 deviceObject := GetDevice(device)
3808 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3809 assert(descriptorPoolObject.device == device)
3810
3811 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003812}
3813
3814@threadSafety("app")
3815cmd VkResult vkResetDescriptorPool(
3816 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08003817 VkDescriptorPool descriptorPool,
3818 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003819 deviceObject := GetDevice(device)
3820 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3821 assert(descriptorPoolObject.device == device)
3822
3823 return ?
3824}
3825
3826@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003827cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003828 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003829 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003830 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003831 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003832 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003833 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003834
Jesse Hall03b6fe12015-11-24 12:44:21 -08003835 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
3836 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003837 setLayout := setLayouts[i]
3838 setLayoutObject := GetDescriptorSetLayout(setLayout)
3839 assert(setLayoutObject.device == device)
3840 }
3841
Jesse Hall03b6fe12015-11-24 12:44:21 -08003842 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
3843 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003844 descriptorSet := ?
3845 descriptorSets[i] = descriptorSet
3846 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
3847 }
3848
3849 return ?
3850}
3851
Jesse Hallf09c6b12015-08-15 19:54:28 -07003852cmd VkResult vkFreeDescriptorSets(
3853 VkDevice device,
3854 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003855 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07003856 const VkDescriptorSet* pDescriptorSets) {
3857 deviceObject := GetDevice(device)
3858 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3859
Jesse Hall03b6fe12015-11-24 12:44:21 -08003860 descriptorSets := pDescriptorSets[0:descriptorSetCount]
3861 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07003862 descriptorSet := descriptorSets[i]
3863 descriptorSetObject := GetDescriptorSet(descriptorSet)
3864 assert(descriptorSetObject.device == device)
3865 State.DescriptorSets[descriptorSet] = null
3866 }
3867
3868 return ?
3869}
3870
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003871cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003872 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08003873 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003874 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08003875 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003876 const VkCopyDescriptorSet* pDescriptorCopies) {
3877 deviceObject := GetDevice(device)
3878
Jesse Hallb00daad2015-11-29 19:46:20 -08003879 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
3880 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003881 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003882 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003883 assert(descriptorWriteObject.device == device)
3884 }
3885
Jesse Hallb00daad2015-11-29 19:46:20 -08003886 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
3887 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003888 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003889 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003890 assert(descriptorCopyObject.device == device)
3891 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003892}
3893
3894
3895// Framebuffer functions
3896
3897@threadSafety("system")
3898cmd VkResult vkCreateFramebuffer(
3899 VkDevice device,
3900 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003901 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003902 VkFramebuffer* pFramebuffer) {
3903 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
3904 deviceObject := GetDevice(device)
3905
3906 framebuffer := ?
3907 pFramebuffer[0] = framebuffer
3908 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
3909
3910 return ?
3911}
3912
3913@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003914cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003915 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003916 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003917 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003918 deviceObject := GetDevice(device)
3919 framebufferObject := GetFramebuffer(framebuffer)
3920 assert(framebufferObject.device == device)
3921
3922 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003923}
3924
3925
3926// Renderpass functions
3927
3928@threadSafety("system")
3929cmd VkResult vkCreateRenderPass(
3930 VkDevice device,
3931 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003932 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003933 VkRenderPass* pRenderPass) {
3934 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
3935 deviceObject := GetDevice(device)
3936
3937 renderpass := ?
3938 pRenderPass[0] = renderpass
3939 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
3940
3941 return ?
3942}
3943
3944@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003945cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003946 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003947 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003948 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003949 deviceObject := GetDevice(device)
3950 renderPassObject := GetRenderPass(renderPass)
3951 assert(renderPassObject.device == device)
3952
3953 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003954}
3955
Jesse Hall606a54e2015-11-19 22:17:28 -08003956cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003957 VkDevice device,
3958 VkRenderPass renderPass,
3959 VkExtent2D* pGranularity) {
3960 deviceObject := GetDevice(device)
3961 renderPassObject := GetRenderPass(renderPass)
3962
3963 granularity := ?
3964 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07003965}
3966
3967// Command pool functions
3968
3969cmd VkResult vkCreateCommandPool(
3970 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003971 const VkCommandPoolCreateInfo* pCreateInfo,
3972 const VkAllocationCallbacks* pAllocator,
3973 VkCommandPool* pCommandPool) {
3974 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003975 deviceObject := GetDevice(device)
3976
Jesse Hall3fbc8562015-11-29 22:10:52 -08003977 commandPool := ?
3978 pCommandPool[0] = commandPool
3979 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003980
3981 return ?
3982}
3983
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003984cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003985 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003986 VkCommandPool commandPool,
3987 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003988 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003989 commandPoolObject := GetCommandPool(commandPool)
3990 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003991
Jesse Hall3fbc8562015-11-29 22:10:52 -08003992 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003993}
3994
3995cmd VkResult vkResetCommandPool(
3996 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003997 VkCommandPool commandPool,
3998 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003999 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004000 commandPoolObject := GetCommandPool(commandPool)
4001 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004002
4003 return ?
4004}
4005
4006// Command buffer functions
4007
Jesse Hall3fbc8562015-11-29 22:10:52 -08004008macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4009 memoryObject := GetDeviceMemory(memory)
4010 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004011
Jesse Hall3fbc8562015-11-29 22:10:52 -08004012 commandBufferObject := GetCommandBuffer(commandBuffer)
4013 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004014}
4015
Jesse Hall3fbc8562015-11-29 22:10:52 -08004016macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4017 memoryObject := GetDeviceMemory(memory)
4018 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004019
Jesse Hall3fbc8562015-11-29 22:10:52 -08004020 commandBufferObject := GetCommandBuffer(commandBuffer)
4021 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004022}
4023
4024@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004025cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004026 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004027 const VkCommandBufferAllocateInfo* pAllocateInfo,
4028 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004029 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004030
Jesse Hall3dd678a2016-01-08 21:52:01 -08004031 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004032 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004033 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004034 commandBuffer := ?
4035 commandBuffers[i] = commandBuffer
4036 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004037 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004038
4039 return ?
4040}
4041
4042@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004043cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004044 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004045 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004046 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004047 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004048 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004049
Jesse Hall3fbc8562015-11-29 22:10:52 -08004050 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004051 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004052 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4053 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004054 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004055 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004056 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004057}
4058
4059@threadSafety("app")
4060cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004061 VkCommandBuffer commandBuffer,
4062 const VkCommandBufferBeginInfo* pBeginInfo) {
4063 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4064 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004065
4066 // TODO: iterate over boundObjects and clear memory bindings
4067
4068 return ?
4069}
4070
4071@threadSafety("app")
4072cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004073 VkCommandBuffer commandBuffer) {
4074 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004075
4076 return ?
4077}
4078
4079@threadSafety("app")
4080cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004081 VkCommandBuffer commandBuffer,
4082 VkCommandBufferResetFlags flags) {
4083 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004084
4085 // TODO: iterate over boundObjects and clear memory bindings
4086
4087 return ?
4088}
4089
4090
4091// Command buffer building functions
4092
4093@threadSafety("app")
4094cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004095 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004096 VkPipelineBindPoint pipelineBindPoint,
4097 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004098 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004099 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004100 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004101
Jesse Halld8bade02015-11-24 10:24:18 -08004102 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004103 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4104 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4105 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004106 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004107}
4108
4109@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004110cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004111 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004112 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004113 u32 viewportCount,
4114 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004115 commandBufferObject := GetCommandBuffer(commandBuffer)
4116 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004117}
4118
4119@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004120cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004121 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004122 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004123 u32 scissorCount,
4124 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004125 commandBufferObject := GetCommandBuffer(commandBuffer)
4126 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004127}
4128
4129@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004130cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004131 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004132 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004133 commandBufferObject := GetCommandBuffer(commandBuffer)
4134 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004135}
4136
4137@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004138cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004139 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004140 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004141 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004142 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004143 commandBufferObject := GetCommandBuffer(commandBuffer)
4144 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004145}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004146
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004147@threadSafety("app")
4148cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004149 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004150 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4151 // an annotation as a quick hack to pass this to the template without
4152 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004153 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004154 commandBufferObject := GetCommandBuffer(commandBuffer)
4155 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004156}
4157
4158@threadSafety("app")
4159cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004160 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004161 f32 minDepthBounds,
4162 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004163 commandBufferObject := GetCommandBuffer(commandBuffer)
4164 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004165}
4166
4167@threadSafety("app")
4168cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004169 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004170 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004171 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004172 commandBufferObject := GetCommandBuffer(commandBuffer)
4173 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004174}
4175
4176@threadSafety("app")
4177cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004178 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004179 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004180 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004181 commandBufferObject := GetCommandBuffer(commandBuffer)
4182 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004183}
4184
4185@threadSafety("app")
4186cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004187 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004188 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004189 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004190 commandBufferObject := GetCommandBuffer(commandBuffer)
4191 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004192}
4193
4194@threadSafety("app")
4195cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004196 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004197 VkPipelineBindPoint pipelineBindPoint,
4198 VkPipelineLayout layout,
4199 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004200 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004201 const VkDescriptorSet* pDescriptorSets,
4202 u32 dynamicOffsetCount,
4203 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004204 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004205
Jesse Hall03b6fe12015-11-24 12:44:21 -08004206 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4207 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004208 descriptorSet := descriptorSets[i]
4209 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004210 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004211 }
4212
4213 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4214 for i in (0 .. dynamicOffsetCount) {
4215 dynamicOffset := dynamicOffsets[i]
4216 }
4217
Jesse Halld8bade02015-11-24 10:24:18 -08004218 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004219 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4220 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4221 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004222 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004223}
4224
4225@threadSafety("app")
4226cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004227 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004228 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004229 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004230 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004231 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004232 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004233 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004234
Jesse Hall3fbc8562015-11-29 22:10:52 -08004235 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004236
Jesse Hall3fbc8562015-11-29 22:10:52 -08004237 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004238}
4239
4240@threadSafety("app")
4241cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004242 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004243 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004244 u32 bindingCount,
4245 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004246 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004247 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004248
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004249 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004250 buffers := pBuffers[0:bindingCount]
4251 offsets := pOffsets[0:bindingCount]
4252 for i in (0 .. bindingCount) {
4253 buffer := buffers[i]
4254 offset := offsets[i]
4255 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004256 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004257
Jesse Hall3fbc8562015-11-29 22:10:52 -08004258 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004259 }
4260
Jesse Hall3fbc8562015-11-29 22:10:52 -08004261 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004262}
4263
4264@threadSafety("app")
4265cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004266 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004267 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004268 u32 instanceCount,
4269 u32 firstVertex,
4270 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004271 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004272
Jesse Hall3fbc8562015-11-29 22:10:52 -08004273 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004274}
4275
4276@threadSafety("app")
4277cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004278 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004279 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004280 u32 instanceCount,
4281 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004282 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004283 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004284 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004285
Jesse Hall3fbc8562015-11-29 22:10:52 -08004286 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004287}
4288
4289@threadSafety("app")
4290cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004291 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004292 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004293 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004294 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004295 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004296 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004297 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004298 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299
Jesse Hall3fbc8562015-11-29 22:10:52 -08004300 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004301
Jesse Hall3fbc8562015-11-29 22:10:52 -08004302 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004303}
4304
4305@threadSafety("app")
4306cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004307 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004308 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004309 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004310 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004311 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004312 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004313 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004314 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004315
Jesse Hall3fbc8562015-11-29 22:10:52 -08004316 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004317
Jesse Hall3fbc8562015-11-29 22:10:52 -08004318 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004319}
4320
4321@threadSafety("app")
4322cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004323 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004324 u32 x,
4325 u32 y,
4326 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004327 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004328
Jesse Hall3fbc8562015-11-29 22:10:52 -08004329 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004330}
4331
4332@threadSafety("app")
4333cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004334 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004335 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004336 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004337 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004338 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004339 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004340
Jesse Hall3fbc8562015-11-29 22:10:52 -08004341 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004342
Jesse Hall3fbc8562015-11-29 22:10:52 -08004343 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004344}
4345
4346@threadSafety("app")
4347cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004348 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004349 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004350 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004351 u32 regionCount,
4352 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004353 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004354 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004355 dstBufferObject := GetBuffer(dstBuffer)
4356 assert(commandBufferObject.device == srcBufferObject.device)
4357 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004358
4359 regions := pRegions[0:regionCount]
4360 for i in (0 .. regionCount) {
4361 region := regions[i]
4362 }
4363
Jesse Hall3fbc8562015-11-29 22:10:52 -08004364 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4365 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004366
Jesse Hall65ab5522015-11-30 00:07:16 -08004367 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004368}
4369
4370@threadSafety("app")
4371cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004372 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004373 VkImage srcImage,
4374 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004375 VkImage dstImage,
4376 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004377 u32 regionCount,
4378 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004379 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004380 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004381 dstImageObject := GetImage(dstImage)
4382 assert(commandBufferObject.device == srcImageObject.device)
4383 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004384
4385 regions := pRegions[0:regionCount]
4386 for i in (0 .. regionCount) {
4387 region := regions[i]
4388 }
4389
Jesse Hall3fbc8562015-11-29 22:10:52 -08004390 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4391 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004392
Jesse Hall65ab5522015-11-30 00:07:16 -08004393 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004394}
4395
4396@threadSafety("app")
4397cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004398 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004399 VkImage srcImage,
4400 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004401 VkImage dstImage,
4402 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004403 u32 regionCount,
4404 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004405 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004406 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004407 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004408 dstImageObject := GetImage(dstImage)
4409 assert(commandBufferObject.device == srcImageObject.device)
4410 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004411
4412 regions := pRegions[0:regionCount]
4413 for i in (0 .. regionCount) {
4414 region := regions[i]
4415 }
4416
Jesse Hall3fbc8562015-11-29 22:10:52 -08004417 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4418 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004419
Jesse Hall3fbc8562015-11-29 22:10:52 -08004420 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004421}
4422
4423@threadSafety("app")
4424cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004425 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004426 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004427 VkImage dstImage,
4428 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004429 u32 regionCount,
4430 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004431 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004432 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004433 dstImageObject := GetImage(dstImage)
4434 assert(commandBufferObject.device == srcBufferObject.device)
4435 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004436
4437 regions := pRegions[0:regionCount]
4438 for i in (0 .. regionCount) {
4439 region := regions[i]
4440 }
4441
Jesse Hall3fbc8562015-11-29 22:10:52 -08004442 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4443 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004444
Jesse Hall65ab5522015-11-30 00:07:16 -08004445 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004446}
4447
4448@threadSafety("app")
4449cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004450 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004451 VkImage srcImage,
4452 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004453 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004454 u32 regionCount,
4455 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004456 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004457 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004458 dstBufferObject := GetBuffer(dstBuffer)
4459 assert(commandBufferObject.device == srcImageObject.device)
4460 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004461
4462 regions := pRegions[0:regionCount]
4463 for i in (0 .. regionCount) {
4464 region := regions[i]
4465 }
4466
Jesse Hall3fbc8562015-11-29 22:10:52 -08004467 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4468 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004469
Jesse Hall65ab5522015-11-30 00:07:16 -08004470 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004471}
4472
4473@threadSafety("app")
4474cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004475 VkCommandBuffer commandBuffer,
4476 VkBuffer dstBuffer,
4477 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004478 VkDeviceSize dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004479 const u32* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004480 commandBufferObject := GetCommandBuffer(commandBuffer)
4481 dstBufferObject := GetBuffer(dstBuffer)
4482 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004483
4484 data := pData[0:dataSize]
4485
Jesse Hall3fbc8562015-11-29 22:10:52 -08004486 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004487
Jesse Hall65ab5522015-11-30 00:07:16 -08004488 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004489}
4490
4491@threadSafety("app")
4492cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004493 VkCommandBuffer commandBuffer,
4494 VkBuffer dstBuffer,
4495 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004496 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004497 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004498 commandBufferObject := GetCommandBuffer(commandBuffer)
4499 dstBufferObject := GetBuffer(dstBuffer)
4500 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004501
Jesse Hall65ab5522015-11-30 00:07:16 -08004502 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004503}
4504
4505@threadSafety("app")
4506cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004507 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004508 VkImage image,
4509 VkImageLayout imageLayout,
4510 const VkClearColorValue* pColor,
4511 u32 rangeCount,
4512 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004513 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004514 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004515 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004516
4517 ranges := pRanges[0:rangeCount]
4518 for i in (0 .. rangeCount) {
4519 range := ranges[i]
4520 }
4521
Jesse Hall3fbc8562015-11-29 22:10:52 -08004522 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004523
Jesse Hall3fbc8562015-11-29 22:10:52 -08004524 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004525}
4526
4527@threadSafety("app")
4528cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004529 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004530 VkImage image,
4531 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004532 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004533 u32 rangeCount,
4534 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004535 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004536 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004537 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004538
4539 ranges := pRanges[0:rangeCount]
4540 for i in (0 .. rangeCount) {
4541 range := ranges[i]
4542 }
4543
Jesse Hall3fbc8562015-11-29 22:10:52 -08004544 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004545
Jesse Hall3fbc8562015-11-29 22:10:52 -08004546 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004547}
4548
4549@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08004550cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004551 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08004552 u32 attachmentCount,
4553 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004554 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08004555 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004556 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004557
4558 rects := pRects[0:rectCount]
4559 for i in (0 .. rectCount) {
4560 rect := rects[i]
4561 }
4562
Jesse Hall3fbc8562015-11-29 22:10:52 -08004563 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004564}
4565
4566@threadSafety("app")
4567cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004568 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004569 VkImage srcImage,
4570 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004571 VkImage dstImage,
4572 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004573 u32 regionCount,
4574 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004575 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004576 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004577 dstImageObject := GetImage(dstImage)
4578 assert(commandBufferObject.device == srcImageObject.device)
4579 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004580
4581 regions := pRegions[0:regionCount]
4582 for i in (0 .. regionCount) {
4583 region := regions[i]
4584 }
4585
Jesse Hall3fbc8562015-11-29 22:10:52 -08004586 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4587 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004588
Jesse Hall3fbc8562015-11-29 22:10:52 -08004589 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004590}
4591
4592@threadSafety("app")
4593cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004594 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004595 VkEvent event,
4596 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004597 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004598 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004599 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004600}
4601
4602@threadSafety("app")
4603cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004604 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004605 VkEvent event,
4606 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004607 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004608 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004609 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004610}
4611
4612@threadSafety("app")
4613cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004614 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004615 u32 eventCount,
4616 const VkEvent* pEvents,
4617 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004618 VkPipelineStageFlags dstStageMask,
4619 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004620 const VkMemoryBarrier* pMemoryBarriers,
4621 u32 bufferMemoryBarrierCount,
4622 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4623 u32 imageMemoryBarrierCount,
4624 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004625 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004626
4627 events := pEvents[0:eventCount]
4628 for i in (0 .. eventCount) {
4629 event := events[i]
4630 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004631 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004632 }
4633
Jesse Hall3dd678a2016-01-08 21:52:01 -08004634 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004635 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004636 memoryBarrier := memoryBarriers[i]
4637 }
4638 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4639 for i in (0 .. bufferMemoryBarrierCount) {
4640 bufferMemoryBarrier := bufferMemoryBarriers[i]
4641 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4642 assert(bufferObject.device == commandBufferObject.device)
4643 }
4644 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4645 for i in (0 .. imageMemoryBarrierCount) {
4646 imageMemoryBarrier := imageMemoryBarriers[i]
4647 imageObject := GetImage(imageMemoryBarrier.image)
4648 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004649 }
4650}
4651
4652@threadSafety("app")
4653cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004654 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004655 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004656 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08004657 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004658 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004659 const VkMemoryBarrier* pMemoryBarriers,
4660 u32 bufferMemoryBarrierCount,
4661 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4662 u32 imageMemoryBarrierCount,
4663 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004664 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004665
Jesse Hall3dd678a2016-01-08 21:52:01 -08004666 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004667 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004668 memoryBarrier := memoryBarriers[i]
4669 }
4670 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4671 for i in (0 .. bufferMemoryBarrierCount) {
4672 bufferMemoryBarrier := bufferMemoryBarriers[i]
4673 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4674 assert(bufferObject.device == commandBufferObject.device)
4675 }
4676 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4677 for i in (0 .. imageMemoryBarrierCount) {
4678 imageMemoryBarrier := imageMemoryBarriers[i]
4679 imageObject := GetImage(imageMemoryBarrier.image)
4680 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004681 }
4682}
4683
4684@threadSafety("app")
4685cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004686 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004687 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004688 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004689 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004690 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004691 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004692 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004693}
4694
4695@threadSafety("app")
4696cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004697 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004698 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004699 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004700 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004701 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004702 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004703}
4704
4705@threadSafety("app")
4706cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004707 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004708 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004709 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004710 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004711 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004712 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004713 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004714}
4715
4716@threadSafety("app")
4717cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004718 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08004719 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004720 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004721 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004722 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004723 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004724 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004725}
4726
4727@threadSafety("app")
4728cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004729 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004730 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004731 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004732 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004733 VkBuffer dstBuffer,
4734 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004735 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004736 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004737 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004738 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004739 dstBufferObject := GetBuffer(dstBuffer)
4740 assert(commandBufferObject.device == queryPoolObject.device)
4741 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004742}
4743
4744cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004745 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004746 VkPipelineLayout layout,
4747 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004748 u32 offset,
4749 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004750 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004751 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004752 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004753 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004754}
4755
4756@threadSafety("app")
4757cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004758 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004759 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08004760 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004761 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004762 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
4763 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004764 assert(commandBufferObject.device == renderPassObject.device)
4765 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004766
Jesse Hall3fbc8562015-11-29 22:10:52 -08004767 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004768}
4769
4770cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004771 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08004772 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004773 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004774}
4775
4776@threadSafety("app")
4777cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004778 VkCommandBuffer commandBuffer) {
4779 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004780
Jesse Hall3fbc8562015-11-29 22:10:52 -08004781 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004782}
4783
4784cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004785 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004786 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004787 const VkCommandBuffer* pCommandBuffers) {
4788 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004789
Jesse Hall3dd678a2016-01-08 21:52:01 -08004790 commandBuffers := pCommandBuffers[0:commandBufferCount]
4791 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004792 secondaryCommandBuffer := commandBuffers[i]
4793 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
4794 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004795 }
4796}
4797
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004798@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004799cmd void vkDestroySurfaceKHR(
4800 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08004801 VkSurfaceKHR surface,
4802 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004803 instanceObject := GetInstance(instance)
4804 surfaceObject := GetSurface(surface)
4805 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08004806
Jesse Hall1356b0d2015-11-23 17:24:58 -08004807 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08004808}
4809
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004810@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004811cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004812 VkPhysicalDevice physicalDevice,
4813 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004814 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08004815 VkBool32* pSupported) {
4816 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004817
4818 return ?
4819}
4820
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004821@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004822cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
4823 VkPhysicalDevice physicalDevice,
4824 VkSurfaceKHR surface,
4825 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
4826 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4827
4828 surfaceCapabilities := ?
4829 pSurfaceCapabilities[0] = surfaceCapabilities
4830
4831 return ?
4832}
4833
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004834@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004835cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
4836 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004837 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004838 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004839 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004840 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004841
4842 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004843 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004844 surfaceFormats := pSurfaceFormats[0:count]
4845
4846 for i in (0 .. count) {
4847 surfaceFormat := ?
4848 surfaceFormats[i] = surfaceFormat
4849 }
4850
4851 return ?
4852}
4853
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004854@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004855cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
4856 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004857 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004858 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004859 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004860 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004861
4862 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004863 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004864 presentModes := pPresentModes[0:count]
4865
4866 for i in (0 .. count) {
4867 presentMode := ?
4868 presentModes[i] = presentMode
4869 }
4870
4871 return ?
4872}
4873
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004874@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004875cmd VkResult vkCreateSwapchainKHR(
4876 VkDevice device,
4877 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004878 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08004879 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004880 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08004881 deviceObject := GetDevice(device)
4882
4883 swapchain := ?
4884 pSwapchain[0] = swapchain
4885 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
4886
4887 return ?
4888}
4889
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004890@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004891cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08004892 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08004893 VkSwapchainKHR swapchain,
4894 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08004895 deviceObject := GetDevice(device)
4896 swapchainObject := GetSwapchain(swapchain)
4897 assert(swapchainObject.device == device)
4898
4899 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08004900}
4901
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004902@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004903cmd VkResult vkGetSwapchainImagesKHR(
4904 VkDevice device,
4905 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004906 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08004907 VkImage* pSwapchainImages) {
4908 deviceObject := GetDevice(device)
4909
4910 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004911 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004912 swapchainImages := pSwapchainImages[0:count]
4913
4914 for i in (0 .. count) {
4915 swapchainImage := ?
4916 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08004917 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08004918 }
4919
4920 return ?
4921}
4922
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004923@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004924cmd VkResult vkAcquireNextImageKHR(
4925 VkDevice device,
4926 VkSwapchainKHR swapchain,
4927 u64 timeout,
4928 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004929 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08004930 u32* pImageIndex) {
4931 deviceObject := GetDevice(device)
4932 swapchainObject := GetSwapchain(swapchain)
4933
4934 imageIndex := ?
4935 pImageIndex[0] = imageIndex
4936
4937 return ?
4938}
4939
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004940@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004941cmd VkResult vkQueuePresentKHR(
4942 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004943 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08004944 queueObject := GetQueue(queue)
4945
4946 presentInfo := ?
4947 pPresentInfo[0] = presentInfo
4948
4949 return ?
4950}
4951
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004952@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004953cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
4954 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004955 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004956 VkDisplayPropertiesKHR* pProperties) {
4957 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4958 return ?
4959}
4960
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004961@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004962cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
4963 VkPhysicalDevice physicalDevice,
4964 u32* pPropertyCount,
4965 VkDisplayPlanePropertiesKHR* pProperties) {
4966 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4967 return ?
4968}
4969
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004970@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004971cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
4972 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004973 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004974 u32* pDisplayCount,
4975 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08004976 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4977 return ?
4978}
4979
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004980@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004981cmd VkResult vkGetDisplayModePropertiesKHR(
4982 VkPhysicalDevice physicalDevice,
4983 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004984 u32* pPropertyCount,
4985 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004986 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4987 return ?
4988}
4989
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004990@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004991cmd VkResult vkCreateDisplayModeKHR(
4992 VkPhysicalDevice physicalDevice,
4993 VkDisplayKHR display,
4994 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004995 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004996 VkDisplayModeKHR* pMode) {
4997 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4998 return ?
4999}
5000
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005001@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005002cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005003 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005004 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005005 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005006 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005007 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5008 return ?
5009}
5010
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005011@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005012cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5013 VkInstance instance,
5014 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005015 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005016 VkSurfaceKHR* pSurface) {
5017 return ?
5018}
5019
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005020@extension("VK_KHR_display_swapchain")
5021cmd VkResult vkCreateSharedSwapchainsKHR(
5022 VkDevice device,
5023 u32 swapchainCount,
5024 const VkSwapchainCreateInfoKHR* pCreateInfos,
5025 const VkAllocationCallbacks* pAllocator,
5026 VkSwapchainKHR* pSwapchains) {
5027 return ?
5028}
5029
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005030@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005031cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005032 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005033 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005034 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005035 VkSurfaceKHR* pSurface) {
5036 instanceObject := GetInstance(instance)
5037 return ?
5038}
5039
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005040@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005041cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5042 VkPhysicalDevice physicalDevice,
5043 u32 queueFamilyIndex,
5044 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005045 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005046 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5047 return ?
5048}
5049
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005050@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005051cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005052 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005053 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005054 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005055 VkSurfaceKHR* pSurface) {
5056 instanceObject := GetInstance(instance)
5057 return ?
5058}
5059
Jesse Hall523db342015-11-30 21:12:55 -08005060@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005061cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5062 VkPhysicalDevice physicalDevice,
5063 u32 queueFamilyIndex,
5064 platform.xcb_connection_t* connection,
5065 platform.xcb_visualid_t visual_id) {
5066 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5067 return ?
5068}
5069
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005070@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005071cmd VkResult vkCreateWaylandSurfaceKHR(
5072 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005073 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005074 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005075 VkSurfaceKHR* pSurface) {
5076 instanceObject := GetInstance(instance)
5077 return ?
5078}
5079
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005080@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005081cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5082 VkPhysicalDevice physicalDevice,
5083 u32 queueFamilyIndex,
5084 platform.wl_display* display) {
5085 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5086 return ?
5087}
5088
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005089@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005090cmd VkResult vkCreateMirSurfaceKHR(
5091 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005092 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005093 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005094 VkSurfaceKHR* pSurface) {
5095 instanceObject := GetInstance(instance)
5096 return ?
5097}
5098
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005099@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005100cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5101 VkPhysicalDevice physicalDevice,
5102 u32 queueFamilyIndex,
5103 platform.MirConnection* connection) {
5104 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5105 return ?
5106}
5107
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005108@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005109cmd VkResult vkCreateAndroidSurfaceKHR(
5110 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005111 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005112 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005113 VkSurfaceKHR* pSurface) {
5114 instanceObject := GetInstance(instance)
5115 return ?
5116}
5117
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005118@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005119cmd VkResult vkCreateWin32SurfaceKHR(
5120 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005121 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005122 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005123 VkSurfaceKHR* pSurface) {
5124 instanceObject := GetInstance(instance)
5125 return ?
5126}
5127
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005128@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005129cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5130 VkPhysicalDevice physicalDevice,
5131 u32 queueFamilyIndex) {
5132 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5133 return ?
5134}
5135
Jesse Hall715b86a2016-01-16 16:34:29 -08005136@extension("VK_EXT_debug_report")
5137@external type void* PFN_vkDebugReportCallbackEXT
5138@extension("VK_EXT_debug_report")
5139@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5140 VkDebugReportFlagsEXT flags,
5141 VkDebugReportObjectTypeEXT objectType,
5142 u64 object,
5143 platform.size_t location,
5144 s32 messageCode,
5145 const char* pLayerPrefix,
5146 const char* pMessage,
5147 void* pUserData) {
5148 return ?
5149}
5150
5151@extension("VK_EXT_debug_report")
5152cmd VkResult vkCreateDebugReportCallbackEXT(
5153 VkInstance instance,
5154 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5155 const VkAllocationCallbacks* pAllocator,
5156 VkDebugReportCallbackEXT* pCallback) {
5157 return ?
5158}
5159
5160@extension("VK_EXT_debug_report")
5161cmd void vkDestroyDebugReportCallbackEXT(
5162 VkInstance instance,
5163 VkDebugReportCallbackEXT callback,
5164 const VkAllocationCallbacks* pAllocator) {
5165}
5166
5167@extension("VK_EXT_debug_report")
5168cmd void vkDebugReportMessageEXT(
5169 VkInstance instance,
5170 VkDebugReportFlagsEXT flags,
5171 VkDebugReportObjectTypeEXT objectType,
5172 u64 object,
5173 platform.size_t location,
5174 s32 messageCode,
5175 const char* pLayerPrefix,
5176 const char* pMessage) {
5177}
5178
Jesse Halld27f6aa2015-08-15 17:58:48 -07005179
5180////////////////
5181// Validation //
5182////////////////
5183
5184extern void validate(string layerName, bool condition, string message)
5185
5186
5187/////////////////////////////
5188// Internal State Tracking //
5189/////////////////////////////
5190
5191StateObject State
5192
5193@internal class StateObject {
5194 // Dispatchable objects.
5195 map!(VkInstance, ref!InstanceObject) Instances
5196 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5197 map!(VkDevice, ref!DeviceObject) Devices
5198 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005199 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005200
5201 // Non-dispatchable objects.
5202 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5203 map!(VkBuffer, ref!BufferObject) Buffers
5204 map!(VkBufferView, ref!BufferViewObject) BufferViews
5205 map!(VkImage, ref!ImageObject) Images
5206 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005207 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005208 map!(VkPipeline, ref!PipelineObject) Pipelines
5209 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5210 map!(VkSampler, ref!SamplerObject) Samplers
5211 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5212 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5213 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005214 map!(VkFence, ref!FenceObject) Fences
5215 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5216 map!(VkEvent, ref!EventObject) Events
5217 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5218 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5219 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5220 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005221 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005222 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005223 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005224}
5225
5226@internal class InstanceObject {
5227}
5228
5229@internal class PhysicalDeviceObject {
5230 VkInstance instance
5231}
5232
5233@internal class DeviceObject {
5234 VkPhysicalDevice physicalDevice
5235}
5236
5237@internal class QueueObject {
5238 VkDevice device
5239 VkQueueFlags flags
5240}
5241
Jesse Hall3fbc8562015-11-29 22:10:52 -08005242@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005243 VkDevice device
5244 map!(u64, VkDeviceMemory) boundObjects
5245 VkQueueFlags queueFlags
5246}
5247
5248@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005249 VkDevice device
5250 VkDeviceSize allocationSize
5251 map!(u64, VkDeviceSize) boundObjects
5252 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005253}
5254
5255@internal class BufferObject {
5256 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005257 VkDeviceMemory memory
5258 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005259}
5260
5261@internal class BufferViewObject {
5262 VkDevice device
5263 VkBuffer buffer
5264}
5265
5266@internal class ImageObject {
5267 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005268 VkDeviceMemory memory
5269 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005270}
5271
5272@internal class ImageViewObject {
5273 VkDevice device
5274 VkImage image
5275}
5276
Jesse Halld27f6aa2015-08-15 17:58:48 -07005277@internal class ShaderObject {
5278 VkDevice device
5279}
5280
5281@internal class ShaderModuleObject {
5282 VkDevice device
5283}
5284
5285@internal class PipelineObject {
5286 VkDevice device
5287}
5288
5289@internal class PipelineLayoutObject {
5290 VkDevice device
5291}
5292
5293@internal class SamplerObject {
5294 VkDevice device
5295}
5296
5297@internal class DescriptorSetObject {
5298 VkDevice device
5299}
5300
5301@internal class DescriptorSetLayoutObject {
5302 VkDevice device
5303}
5304
5305@internal class DescriptorPoolObject {
5306 VkDevice device
5307}
5308
Jesse Halld27f6aa2015-08-15 17:58:48 -07005309@internal class FenceObject {
5310 VkDevice device
5311 bool signaled
5312}
5313
5314@internal class SemaphoreObject {
5315 VkDevice device
5316}
5317
5318@internal class EventObject {
5319 VkDevice device
5320}
5321
5322@internal class QueryPoolObject {
5323 VkDevice device
5324}
5325
5326@internal class FramebufferObject {
5327 VkDevice device
5328}
5329
5330@internal class RenderPassObject {
5331 VkDevice device
5332}
5333
5334@internal class PipelineCacheObject {
5335 VkDevice device
5336}
5337
Jesse Hall3fbc8562015-11-29 22:10:52 -08005338@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005339 VkDevice device
5340}
5341
Jesse Hall1356b0d2015-11-23 17:24:58 -08005342@internal class SurfaceObject {
5343 VkInstance instance
5344}
5345
Michael Lentine88594d72015-11-12 12:49:45 -08005346@internal class SwapchainObject {
5347 VkDevice device
5348}
5349
Jesse Halld27f6aa2015-08-15 17:58:48 -07005350macro ref!InstanceObject GetInstance(VkInstance instance) {
5351 assert(instance in State.Instances)
5352 return State.Instances[instance]
5353}
5354
5355macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
5356 assert(physicalDevice in State.PhysicalDevices)
5357 return State.PhysicalDevices[physicalDevice]
5358}
5359
5360macro ref!DeviceObject GetDevice(VkDevice device) {
5361 assert(device in State.Devices)
5362 return State.Devices[device]
5363}
5364
5365macro ref!QueueObject GetQueue(VkQueue queue) {
5366 assert(queue in State.Queues)
5367 return State.Queues[queue]
5368}
5369
Jesse Hall3fbc8562015-11-29 22:10:52 -08005370macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
5371 assert(commandBuffer in State.CommandBuffers)
5372 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005373}
5374
Jesse Hall3fbc8562015-11-29 22:10:52 -08005375macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
5376 assert(memory in State.DeviceMemories)
5377 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005378}
5379
5380macro ref!BufferObject GetBuffer(VkBuffer buffer) {
5381 assert(buffer in State.Buffers)
5382 return State.Buffers[buffer]
5383}
5384
5385macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
5386 assert(bufferView in State.BufferViews)
5387 return State.BufferViews[bufferView]
5388}
5389
5390macro ref!ImageObject GetImage(VkImage image) {
5391 assert(image in State.Images)
5392 return State.Images[image]
5393}
5394
5395macro ref!ImageViewObject GetImageView(VkImageView imageView) {
5396 assert(imageView in State.ImageViews)
5397 return State.ImageViews[imageView]
5398}
5399
Jesse Halld27f6aa2015-08-15 17:58:48 -07005400macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
5401 assert(shaderModule in State.ShaderModules)
5402 return State.ShaderModules[shaderModule]
5403}
5404
5405macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
5406 assert(pipeline in State.Pipelines)
5407 return State.Pipelines[pipeline]
5408}
5409
5410macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
5411 assert(pipelineLayout in State.PipelineLayouts)
5412 return State.PipelineLayouts[pipelineLayout]
5413}
5414
5415macro ref!SamplerObject GetSampler(VkSampler sampler) {
5416 assert(sampler in State.Samplers)
5417 return State.Samplers[sampler]
5418}
5419
5420macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
5421 assert(descriptorSet in State.DescriptorSets)
5422 return State.DescriptorSets[descriptorSet]
5423}
5424
5425macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
5426 assert(descriptorSetLayout in State.DescriptorSetLayouts)
5427 return State.DescriptorSetLayouts[descriptorSetLayout]
5428}
5429
5430macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
5431 assert(descriptorPool in State.DescriptorPools)
5432 return State.DescriptorPools[descriptorPool]
5433}
5434
Jesse Halld27f6aa2015-08-15 17:58:48 -07005435macro ref!FenceObject GetFence(VkFence fence) {
5436 assert(fence in State.Fences)
5437 return State.Fences[fence]
5438}
5439
5440macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
5441 assert(semaphore in State.Semaphores)
5442 return State.Semaphores[semaphore]
5443}
5444
5445macro ref!EventObject GetEvent(VkEvent event) {
5446 assert(event in State.Events)
5447 return State.Events[event]
5448}
5449
5450macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
5451 assert(queryPool in State.QueryPools)
5452 return State.QueryPools[queryPool]
5453}
5454
5455macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
5456 assert(framebuffer in State.Framebuffers)
5457 return State.Framebuffers[framebuffer]
5458}
5459
5460macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
5461 assert(renderPass in State.RenderPasses)
5462 return State.RenderPasses[renderPass]
5463}
5464
5465macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
5466 assert(pipelineCache in State.PipelineCaches)
5467 return State.PipelineCaches[pipelineCache]
5468}
5469
Jesse Hall3fbc8562015-11-29 22:10:52 -08005470macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
5471 assert(commandPool in State.CommandPools)
5472 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07005473}
Michael Lentine88594d72015-11-12 12:49:45 -08005474
Jesse Hall1356b0d2015-11-23 17:24:58 -08005475macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
5476 assert(surface in State.Surfaces)
5477 return State.Surfaces[surface]
5478}
5479
Michael Lentine88594d72015-11-12 12:49:45 -08005480macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
5481 assert(swapchain in State.Swapchains)
5482 return State.Swapchains[swapchain]
5483}
Jesse Halld8bade02015-11-24 10:24:18 -08005484
5485macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
5486 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
5487}