blob: 9b1e6842d0032d489bbf49eaa83b46542997a406 [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 Hall33faaad2016-01-24 21:00:49 -080031define VERSION_PATCH 2
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall33faaad2016-01-24 21:00:49 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse 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 Hall33faaad2016-01-24 21:00:49 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
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 Hall33faaad2016-01-24 21:00:49 -0800939 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700940}
941
942/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -0800943type VkFlags VkQueryControlFlags
944bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -0800945 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700946}
947
948/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -0800949type VkFlags VkQueryResultFlags
950bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700951 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
952 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
953 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
954 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
955}
956
957/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800958type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800959//bitfield VkShaderModuleCreateFlagBits {
960//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700961
Jesse Halld27f6aa2015-08-15 17:58:48 -0700962/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800963type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800964//bitfield VkEventCreateFlagBits {
965//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700966
Jesse Halla15a4bf2015-11-19 22:48:02 -0800967/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -0800968type VkFlags VkCommandBufferUsageFlags
969bitfield VkCommandBufferUsageFlagBits {
970 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
971 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
972 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700973}
974
975/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -0800976type VkFlags VkQueryPipelineStatisticFlags
977bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -0800978 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
979 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
980 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
981 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
982 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
983 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
984 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
985 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
986 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
987 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
988 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -0700989}
990
991/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -0800992type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -0800993//bitfield VkMemoryMapFlagBits {
994//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700995
996/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -0800997type VkFlags VkImageAspectFlags
998bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700999 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1000 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1001 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1002 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1003}
1004
1005/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001006type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001007bitfield VkSparseMemoryBindFlagBits {
1008 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1009}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001010
1011/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001012type VkFlags VkSparseImageFormatFlags
1013bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001014 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1015 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.
1016 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001017}
1018
1019/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001020type VkFlags VkPipelineStageFlags
1021bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001022 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1023 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1024 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1025 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001026 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1027 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001028 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1029 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1030 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1031 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1032 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1033 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1034 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001035 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1036 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001037
Jesse Hall543a7ff2016-01-08 16:38:30 -08001038 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1039 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001040}
1041
1042/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001043type VkFlags VkAttachmentDescriptionFlags
1044bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001045 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 -07001046}
1047
1048/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001049type VkFlags VkSubpassDescriptionFlags
1050bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001051}
1052
1053/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001054type VkFlags VkCommandPoolCreateFlags
1055bitfield VkCommandPoolCreateFlagBits {
1056 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1057 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001058}
1059
1060/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001061type VkFlags VkCommandPoolResetFlags
1062bitfield VkCommandPoolResetFlagBits {
1063 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001064}
1065
Jesse Hall3fbc8562015-11-29 22:10:52 -08001066type VkFlags VkCommandBufferResetFlags
1067bitfield VkCommandBufferResetFlagBits {
1068 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001069}
1070
Jesse Halld8bade02015-11-24 10:24:18 -08001071type VkFlags VkSampleCountFlags
1072bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001073 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1074 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1075 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1076 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1077 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1078 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1079 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1080}
1081
Jesse Halld8bade02015-11-24 10:24:18 -08001082type VkFlags VkStencilFaceFlags
1083bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001084 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1085 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001086 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001087}
1088
Jesse Halla6429252015-11-29 18:59:42 -08001089/// Instance creation flags
1090type VkFlags VkInstanceCreateFlags
1091//bitfield VkInstanceCreateFlagBits {
1092//}
1093
1094/// Device creation flags
1095type VkFlags VkDeviceCreateFlags
1096//bitfield VkDeviceCreateFlagBits {
1097//}
1098
1099/// Device queue creation flags
1100type VkFlags VkDeviceQueueCreateFlags
1101//bitfield VkDeviceQueueCreateFlagBits {
1102//}
1103
1104/// Query pool creation flags
1105type VkFlags VkQueryPoolCreateFlags
1106//bitfield VkQueryPoolCreateFlagBits {
1107//}
1108
1109/// Buffer view creation flags
1110type VkFlags VkBufferViewCreateFlags
1111//bitfield VkBufferViewCreateFlagBits {
1112//}
1113
1114/// Pipeline cache creation flags
1115type VkFlags VkPipelineCacheCreateFlags
1116//bitfield VkPipelineCacheCreateFlagBits {
1117//}
1118
1119/// Pipeline shader stage creation flags
1120type VkFlags VkPipelineShaderStageCreateFlags
1121//bitfield VkPipelineShaderStageCreateFlagBits {
1122//}
1123
1124/// Descriptor set layout creation flags
1125type VkFlags VkDescriptorSetLayoutCreateFlags
1126//bitfield VkDescriptorSetLayoutCreateFlagBits {
1127//}
1128
1129/// Pipeline vertex input state creation flags
1130type VkFlags VkPipelineVertexInputStateCreateFlags
1131//bitfield VkPipelineVertexInputStateCreateFlagBits {
1132//}
1133
1134/// Pipeline input assembly state creation flags
1135type VkFlags VkPipelineInputAssemblyStateCreateFlags
1136//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1137//}
1138
1139/// Tessellation state creation flags
1140type VkFlags VkPipelineTessellationStateCreateFlags
1141//bitfield VkPipelineTessellationStateCreateFlagBits {
1142//}
1143
1144/// Viewport state creation flags
1145type VkFlags VkPipelineViewportStateCreateFlags
1146//bitfield VkPipelineViewportStateCreateFlagBits {
1147//}
1148
Jesse Hall3fbc8562015-11-29 22:10:52 -08001149/// Rasterization state creation flags
1150type VkFlags VkPipelineRasterizationStateCreateFlags
1151//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001152//}
1153
1154/// Multisample state creation flags
1155type VkFlags VkPipelineMultisampleStateCreateFlags
1156//bitfield VkPipelineMultisampleStateCreateFlagBits {
1157//}
1158
1159/// Color blend state creation flags
1160type VkFlags VkPipelineColorBlendStateCreateFlags
1161//bitfield VkPipelineColorBlendStateCreateFlagBits {
1162//}
1163
1164/// Depth/stencil state creation flags
1165type VkFlags VkPipelineDepthStencilStateCreateFlags
1166//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1167//}
1168
1169/// Dynamic state creation flags
1170type VkFlags VkPipelineDynamicStateCreateFlags
1171//bitfield VkPipelineDynamicStateCreateFlagBits {
1172//}
1173
1174/// Pipeline layout creation flags
1175type VkFlags VkPipelineLayoutCreateFlags
1176//bitfield VkPipelineLayoutCreateFlagBits {
1177//}
1178
1179/// Sampler creation flags
1180type VkFlags VkSamplerCreateFlags
1181//bitfield VkSamplerCreateFlagBits {
1182//}
1183
1184/// Render pass creation flags
1185type VkFlags VkRenderPassCreateFlags
1186//bitfield VkRenderPassCreateFlagBits {
1187//}
1188
1189/// Framebuffer creation flags
1190type VkFlags VkFramebufferCreateFlags
1191//bitfield VkFramebufferCreateFlagBits {
1192//}
1193
Jesse Halldc6d36c2015-11-29 19:12:15 -08001194/// Dependency flags
1195type VkFlags VkDependencyFlags
1196bitfield VkDependencyFlagBits {
1197 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1198}
1199
Jesse Hallc7467b72015-11-29 21:05:26 -08001200/// Cull mode flags
1201type VkFlags VkCullModeFlags
1202bitfield VkCullModeFlagBits {
1203 VK_CULL_MODE_NONE = 0x00000000,
1204 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1205 VK_CULL_MODE_BACK_BIT = 0x00000002,
1206 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1207}
1208
Jesse Hall523db342015-11-30 21:12:55 -08001209@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001210type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001211@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001212bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001213 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001214 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1215 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1216 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1217 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1218 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1219 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1220 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1221 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001222}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001223
Jesse Hall523db342015-11-30 21:12:55 -08001224@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001225type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001226@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001227bitfield VkCompositeAlphaFlagBitsKHR {
1228 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1229 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1230 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1231 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1232}
1233
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001234@extension("VK_KHR_swapchain")
1235type VkFlags VkSwapchainCreateFlagsKHR
1236//@extension("VK_KHR_swapchain")
1237//bitfield VkSwapchainCreateFlagBitsKHR {
1238//}
1239
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001240@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001241type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001242@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001243bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001244 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1245 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1246 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1247 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001248}
1249
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001250@extension("VK_KHR_display")
1251type VkFlags VkDisplaySurfaceCreateFlagsKHR
1252//@extension("VK_KHR_display")
1253//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1254//}
1255
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001256@extension("VK_KHR_display")
1257type VkFlags VkDisplayModeCreateFlagsKHR
1258//@extension("VK_KHR_display")
1259//bitfield VkDisplayModeCreateFlagBitsKHR {
1260//}
1261
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001262@extension("VK_KHR_xlib_surface")
1263type VkFlags VkXlibSurfaceCreateFlagsKHR
1264//@extension("VK_KHR_xlib_surface")
1265//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1266//}
1267
1268@extension("VK_KHR_xcb_surface")
1269type VkFlags VkXcbSurfaceCreateFlagsKHR
1270//@extension("VK_KHR_xcb_surface")
1271//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1272//}
1273
1274@extension("VK_KHR_wayland_surface")
1275type VkFlags VkWaylandSurfaceCreateFlagsKHR
1276//@extension("VK_KHR_wayland_surface")
1277//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1278//}
1279
1280@extension("VK_KHR_mir_surface")
1281type VkFlags VkMirSurfaceCreateFlagsKHR
1282//@extension("VK_KHR_mir_surface")
1283//bitfield VkMirSurfaceCreateFlagBitsKHR {
1284//}
1285
1286@extension("VK_KHR_android_surface")
1287type VkFlags VkAndroidSurfaceCreateFlagsKHR
1288//@extension("VK_KHR_android_surface")
1289//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1290//}
1291
1292@extension("VK_KHR_win32_surface")
1293type VkFlags VkWin32SurfaceCreateFlagsKHR
1294//@extension("VK_KHR_win32_surface")
1295//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1296//}
1297
Jesse Hall715b86a2016-01-16 16:34:29 -08001298@extension("VK_EXT_debug_report")
1299type VkFlags VkDebugReportFlagsEXT
1300@extension("VK_EXT_debug_report")
1301bitfield VkDebugReportFlagBitsEXT {
1302 VK_DEBUG_REPORT_INFO_BIT_EXT = 0x00000001,
1303 VK_DEBUG_REPORT_WARN_BIT_EXT = 0x00000002,
1304 VK_DEBUG_REPORT_PERF_WARN_BIT_EXT = 0x00000004,
1305 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1306 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1307}
1308
Jesse Hall1356b0d2015-11-23 17:24:58 -08001309
Jesse Halld27f6aa2015-08-15 17:58:48 -07001310//////////////////
1311// Structures //
1312//////////////////
1313
1314class VkOffset2D {
1315 s32 x
1316 s32 y
1317}
1318
1319class VkOffset3D {
1320 s32 x
1321 s32 y
1322 s32 z
1323}
1324
1325class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001326 u32 width
1327 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001328}
1329
1330class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001331 u32 width
1332 u32 height
1333 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001334}
1335
1336class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001337 f32 x
1338 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001339 f32 width
1340 f32 height
1341 f32 minDepth
1342 f32 maxDepth
1343}
1344
1345class VkRect2D {
1346 VkOffset2D offset
1347 VkExtent2D extent
1348}
1349
Jesse Halla15a4bf2015-11-19 22:48:02 -08001350class VkClearRect {
1351 VkRect2D rect
1352 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001353 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001354}
1355
Jesse Hall65ab5522015-11-30 00:07:16 -08001356class VkComponentMapping {
1357 VkComponentSwizzle r
1358 VkComponentSwizzle g
1359 VkComponentSwizzle b
1360 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001361}
1362
1363class VkPhysicalDeviceProperties {
1364 u32 apiVersion
1365 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001366 u32 vendorID
1367 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001368 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001369 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1370 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001371 VkPhysicalDeviceLimits limits
1372 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001373}
1374
1375class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001376 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001377 u32 specVersion /// version of the extension specification implemented
1378}
1379
1380class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001381 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001382 u32 specVersion /// version of the layer specification implemented
1383 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001384 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001385}
1386
Jesse Halla366a512015-11-19 22:30:07 -08001387class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001388 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1389 const void* pNext /// Next structure in chain
1390 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001391 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001392 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001393 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001394 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001395 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001396 const VkSemaphore* pSignalSemaphores
1397}
1398
Jesse Halld27f6aa2015-08-15 17:58:48 -07001399class VkApplicationInfo {
1400 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1401 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001402 const char* pApplicationName
1403 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001404 const char* pEngineName
1405 u32 engineVersion
1406 u32 apiVersion
1407}
1408
Jesse Hall3fbc8562015-11-29 22:10:52 -08001409class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001410 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001411 PFN_vkAllocationFunction pfnAllocation
1412 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001413 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001414 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001415 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001416}
1417
1418class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001419 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1420 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001421 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001422 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001423 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001424 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001425}
1426
1427class VkDeviceCreateInfo {
1428 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1429 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001430 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001431 u32 queueCreateInfoCount
1432 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001433 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001434 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001435 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001436 const char* const* ppEnabledExtensionNames
1437 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001438}
1439
1440class VkInstanceCreateInfo {
1441 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1442 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001443 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001444 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001445 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001446 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001447 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001448 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1449}
1450
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001451class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001452 VkQueueFlags queueFlags /// Queue flags
1453 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001454 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001455 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001456}
1457
1458class VkPhysicalDeviceMemoryProperties {
1459 u32 memoryTypeCount
1460 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1461 u32 memoryHeapCount
1462 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1463}
1464
Jesse Hall3fbc8562015-11-29 22:10:52 -08001465class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001466 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001467 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001468 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001469 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1470}
1471
1472class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001473 VkDeviceSize size /// Specified in bytes
1474 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001475 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1476}
1477
1478class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001479 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001480 VkExtent3D imageGranularity
1481 VkSparseImageFormatFlags flags
1482}
1483
1484class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001485 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001486 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001487 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1488 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1489 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001490}
1491
1492class VkMemoryType {
1493 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1494 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1495}
1496
1497class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001498 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001499 VkMemoryHeapFlags flags /// Flags for the heap
1500}
1501
1502class VkMappedMemoryRange {
1503 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1504 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001505 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001506 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1507 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001508}
1509
1510class VkFormatProperties {
1511 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1512 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001513 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001514}
1515
1516class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001517 VkExtent3D maxExtent /// max image dimensions for this resource type
1518 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001519 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001520 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1521 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1522}
1523
Jesse Halla15a4bf2015-11-19 22:48:02 -08001524class VkDescriptorImageInfo {
1525 VkSampler sampler
1526 VkImageView imageView
1527 VkImageLayout imageLayout
1528}
1529
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001530class VkDescriptorBufferInfo {
1531 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1532 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1533 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001534}
1535
Jesse Halld27f6aa2015-08-15 17:58:48 -07001536class VkWriteDescriptorSet {
1537 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1538 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001539 VkDescriptorSet dstSet /// Destination descriptor set
1540 u32 dstBinding /// Binding within the destination descriptor set to write
1541 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001542 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001543 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 -08001544 const VkDescriptorImageInfo* pImageInfo
1545 const VkDescriptorBufferInfo* pBufferInfo
1546 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001547}
1548
1549class VkCopyDescriptorSet {
1550 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1551 const void* pNext /// Pointer to next structure
1552 VkDescriptorSet srcSet /// Source descriptor set
1553 u32 srcBinding /// Binding within the source descriptor set to copy from
1554 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001555 VkDescriptorSet dstSet /// Destination descriptor set
1556 u32 dstBinding /// Binding within the destination descriptor set to copy to
1557 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001558 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001559}
1560
1561class VkBufferCreateInfo {
1562 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1563 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001564 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001565 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001566 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001567 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001568 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001569 const u32* pQueueFamilyIndices
1570}
1571
1572class VkBufferViewCreateInfo {
1573 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1574 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001575 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001576 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001577 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001578 VkDeviceSize offset /// Specified in bytes
1579 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001580}
1581
1582class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001583 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001584 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001585 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001586}
1587
1588class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001589 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001590 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001591 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001592 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001593 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001594}
1595
1596class VkMemoryBarrier {
1597 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1598 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001599 VkAccessFlags srcAccessMask
1600 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001601}
1602
1603class VkBufferMemoryBarrier {
1604 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1605 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001606 VkAccessFlags srcAccessMask
1607 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001608 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001609 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001610 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001611 VkDeviceSize offset /// Offset within the buffer to sync
1612 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001613}
1614
1615class VkImageMemoryBarrier {
1616 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1617 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001618 VkAccessFlags srcAccessMask
1619 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001620 VkImageLayout oldLayout /// Current layout of the image
1621 VkImageLayout newLayout /// New layout to transition the image to
1622 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001623 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001624 VkImage image /// Image to sync
1625 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1626}
1627
1628class VkImageCreateInfo {
1629 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1630 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001631 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001632 VkImageType imageType
1633 VkFormat format
1634 VkExtent3D extent
1635 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001636 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001637 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001638 VkImageTiling tiling
1639 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001640 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001641 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001642 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001643 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001644}
1645
1646class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001647 VkDeviceSize offset /// Specified in bytes
1648 VkDeviceSize size /// Specified in bytes
1649 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001650 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001651 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001652}
1653
1654class VkImageViewCreateInfo {
1655 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1656 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001657 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001658 VkImage image
1659 VkImageViewType viewType
1660 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001661 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001662 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001663}
1664
1665class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001666 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001667 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001668 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001669}
1670
Jesse Halla6429252015-11-29 18:59:42 -08001671class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001672 VkDeviceSize resourceOffset /// Specified in bytes
1673 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001674 VkDeviceMemory memory
1675 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001676 VkSparseMemoryBindFlags flags
1677}
1678
Jesse Halla6429252015-11-29 18:59:42 -08001679class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001680 VkImageSubresource subresource
1681 VkOffset3D offset
1682 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001683 VkDeviceMemory memory
1684 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001685 VkSparseMemoryBindFlags flags
1686}
1687
Jesse Halla6429252015-11-29 18:59:42 -08001688class VkSparseBufferMemoryBindInfo {
1689 VkBuffer buffer
1690 u32 bindCount
1691 const VkSparseMemoryBind* pBinds
1692}
1693
1694class VkSparseImageOpaqueMemoryBindInfo {
1695 VkImage image
1696 u32 bindCount
1697 const VkSparseMemoryBind* pBinds
1698}
1699
1700class VkSparseImageMemoryBindInfo {
1701 VkImage image
1702 u32 bindCount
1703 const VkSparseMemoryBind* pBinds
1704}
1705
1706class VkBindSparseInfo {
1707 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1708 const void* pNext
1709 u32 waitSemaphoreCount
1710 const VkSemaphore* pWaitSemaphores
1711 u32 numBufferBinds
1712 const VkSparseBufferMemoryBindInfo* pBufferBinds
1713 u32 numImageOpaqueBinds
1714 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1715 u32 numImageBinds
1716 const VkSparseImageMemoryBindInfo* pImageBinds
1717 u32 signalSemaphoreCount
1718 const VkSemaphore* pSignalSemaphores
1719}
1720
Jesse Hall65ab5522015-11-30 00:07:16 -08001721class VkImageSubresourceLayers {
1722 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001723 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001724 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001725 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001726}
1727
Jesse Halld27f6aa2015-08-15 17:58:48 -07001728class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001729 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001730 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001731 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001732 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001733 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1734}
1735
1736class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001737 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001738 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08001739 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001740 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07001741}
1742
1743class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001744 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001745 u32 bufferRowLength /// Specified in texels
1746 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001747 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001748 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1749 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1750}
1751
1752class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001753 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001754 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001755 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001756 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001757 VkExtent3D extent
1758}
1759
1760class VkShaderModuleCreateInfo {
1761 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1762 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001763 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001764 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08001765 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07001766}
1767
Jesse Halld27f6aa2015-08-15 17:58:48 -07001768class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08001769 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001770 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08001771 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001772 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
1773 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
1774}
1775
1776class VkDescriptorSetLayoutCreateInfo {
1777 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
1778 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001779 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001780 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08001781 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001782}
1783
Jesse Hall65ab5522015-11-30 00:07:16 -08001784class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001785 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08001786 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001787}
1788
1789class VkDescriptorPoolCreateInfo {
1790 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
1791 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08001792 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001793 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08001794 u32 poolSizeCount
1795 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001796}
1797
Jesse Hall3fbc8562015-11-29 22:10:52 -08001798class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001799 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08001800 const void* pNext /// Pointer to next structure
1801 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08001802 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001803 const VkDescriptorSetLayout* pSetLayouts
1804}
1805
Jesse Halld27f6aa2015-08-15 17:58:48 -07001806class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08001807 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07001808 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08001809 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07001810}
1811
1812class VkSpecializationInfo {
1813 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08001814 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07001815 platform.size_t dataSize /// Size in bytes of pData
1816 const void* pData /// Pointer to SpecConstant data
1817}
1818
1819class VkPipelineShaderStageCreateInfo {
1820 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
1821 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001822 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001823 VkShaderStageFlagBits stage
1824 VkShaderModule module
1825 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07001826 const VkSpecializationInfo* pSpecializationInfo
1827}
1828
1829class VkComputePipelineCreateInfo {
1830 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
1831 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001832 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001833 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001834 VkPipelineLayout layout /// Interface layout of the pipeline
1835 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
1836 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
1837}
1838
1839class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001840 u32 binding /// Vertex buffer binding id
1841 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08001842 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07001843}
1844
1845class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001846 u32 location /// location of the shader vertex attrib
1847 u32 binding /// Vertex buffer binding id
1848 VkFormat format /// format of source data
1849 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001850}
1851
1852class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001853 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
1854 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001855 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001856 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001857 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08001858 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001859 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1860}
1861
1862class VkPipelineInputAssemblyStateCreateInfo {
1863 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
1864 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001865 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001866 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001867 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001868}
1869
1870class VkPipelineTessellationStateCreateInfo {
1871 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
1872 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001873 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001874 u32 patchControlPoints
1875}
1876
1877class VkPipelineViewportStateCreateInfo {
1878 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
1879 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001880 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001881 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001882 const VkViewport* pViewports
1883 u32 scissorCount
1884 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07001885}
1886
Jesse Hall3fbc8562015-11-29 22:10:52 -08001887class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08001888 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001889 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001890 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001891 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001892 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001893 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08001894 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07001895 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001896 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08001897 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001898 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08001899 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001900 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001901}
1902
1903class VkPipelineMultisampleStateCreateInfo {
1904 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
1905 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001906 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001907 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001908 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001909 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001910 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08001911 VkBool32 alphaToCoverageEnable
1912 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001913}
1914
1915class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001916 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001917 VkBlendFactor srcColorBlendFactor
1918 VkBlendFactor dstColorBlendFactor
1919 VkBlendOp colorBlendOp
1920 VkBlendFactor srcAlphaBlendFactor
1921 VkBlendFactor dstAlphaBlendFactor
1922 VkBlendOp alphaBlendOp
1923 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001924}
1925
1926class VkPipelineColorBlendStateCreateInfo {
1927 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
1928 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001929 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001930 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001931 VkLogicOp logicOp
1932 u32 attachmentCount /// # of pAttachments
1933 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08001934 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07001935}
1936
1937class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08001938 VkStencilOp failOp
1939 VkStencilOp passOp
1940 VkStencilOp depthFailOp
1941 VkCompareOp compareOp
1942 u32 compareMask
1943 u32 writeMask
1944 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07001945}
1946
1947class VkPipelineDepthStencilStateCreateInfo {
1948 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
1949 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001950 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001951 VkBool32 depthTestEnable
1952 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001953 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001954 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
1955 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001956 VkStencilOpState front
1957 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001958 f32 minDepthBounds
1959 f32 maxDepthBounds
1960}
1961
1962class VkPipelineDynamicStateCreateInfo {
1963 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
1964 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001965 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001966 u32 dynamicStateCount
1967 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001968}
1969
1970class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08001971 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
1972 const void* pNext /// Pointer to next structure
1973 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001974 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08001975 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001976 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
1977 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
1978 const VkPipelineTessellationStateCreateInfo* pTessellationState
1979 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08001980 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07001981 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
1982 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
1983 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001984 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08001985 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001986 VkRenderPass renderPass
1987 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08001988 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
1989 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 -07001990}
1991
1992class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08001993 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
1994 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001995 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08001996 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
1997 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07001998}
1999
2000class VkPushConstantRange {
2001 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002002 u32 offset /// Start of the range, in bytes
2003 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002004}
2005
2006class VkPipelineLayoutCreateInfo {
2007 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2008 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002009 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002010 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002011 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2012 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2013 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2014}
2015
2016class VkSamplerCreateInfo {
2017 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2018 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002019 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002020 VkFilter magFilter /// Filter mode for magnification
2021 VkFilter minFilter /// Filter mode for minifiation
2022 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2023 VkSamplerAddressMode addressModeU
2024 VkSamplerAddressMode addressModeV
2025 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002026 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002027 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002028 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002029 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002030 VkCompareOp compareOp
2031 f32 minLod
2032 f32 maxLod
2033 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002034 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002035}
2036
Jesse Hall3fbc8562015-11-29 22:10:52 -08002037class VkCommandPoolCreateInfo {
2038 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002039 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002040 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002041 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002042}
2043
Jesse Hall3fbc8562015-11-29 22:10:52 -08002044class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002045 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002046 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002047 VkCommandPool commandPool
2048 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002049 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002050}
2051
Jesse Hall3dd678a2016-01-08 21:52:01 -08002052class VkCommandBufferInheritanceInfo {
2053 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002054 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002055 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002056 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002057 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002058 VkBool32 occlusionQueryEnable
2059 VkQueryControlFlags queryFlags
2060 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002061}
2062
Jesse Hall3dd678a2016-01-08 21:52:01 -08002063class VkCommandBufferBeginInfo {
2064 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2065 const void* pNext /// Pointer to next structure
2066 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2067 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2068}
2069
Jesse Halld27f6aa2015-08-15 17:58:48 -07002070class VkRenderPassBeginInfo {
2071 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2072 const void* pNext /// Pointer to next structure
2073 VkRenderPass renderPass
2074 VkFramebuffer framebuffer
2075 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002076 u32 clearValueCount
2077 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002078}
2079
2080@union
2081/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2082class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002083 f32[4] float32
2084 s32[4] int32
2085 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002086}
2087
2088class VkClearDepthStencilValue {
2089 f32 depth
2090 u32 stencil
2091}
2092
2093@union
2094/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2095class VkClearValue {
2096 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002097 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002098}
2099
Jesse Hallae38f732015-11-19 21:32:50 -08002100class VkClearAttachment {
2101 VkImageAspectFlags aspectMask
2102 u32 colorAttachment
2103 VkClearValue clearValue
2104}
2105
Jesse Halld27f6aa2015-08-15 17:58:48 -07002106class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002107 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002108 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002109 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002110 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2111 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2112 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2113 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2114 VkImageLayout initialLayout
2115 VkImageLayout finalLayout
2116}
2117
2118class VkAttachmentReference {
2119 u32 attachment
2120 VkImageLayout layout
2121}
2122
2123class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002124 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002125 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002126 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002127 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002128 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002129 const VkAttachmentReference* pColorAttachments
2130 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002131 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002132 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002133 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002134}
2135
2136class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002137 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002138 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002139 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002140 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002141 VkAccessFlags srcAccessMask
2142 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002143 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002144}
2145
2146class VkRenderPassCreateInfo {
2147 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2148 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002149 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002150 u32 attachmentCount
2151 const VkAttachmentDescription* pAttachments
2152 u32 subpassCount
2153 const VkSubpassDescription* pSubpasses
2154 u32 dependencyCount
2155 const VkSubpassDependency* pDependencies
2156}
2157
2158class VkEventCreateInfo {
2159 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2160 const void* pNext /// Pointer to next structure
2161 VkEventCreateFlags flags /// Event creation flags
2162}
2163
2164class VkFenceCreateInfo {
2165 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2166 const void* pNext /// Pointer to next structure
2167 VkFenceCreateFlags flags /// Fence creation flags
2168}
2169
2170class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002171 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2172 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2173 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2174 VkBool32 independentBlend /// blending operations are controlled per-attachment
2175 VkBool32 geometryShader /// geometry stage
2176 VkBool32 tessellationShader /// tessellation control and evaluation stage
2177 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002178 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002179 VkBool32 logicOp /// logic operations
2180 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002181 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002182 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002183 VkBool32 depthBiasClamp /// depth bias clamping
2184 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2185 VkBool32 depthBounds /// depth bounds test
2186 VkBool32 wideLines /// lines with width greater than 1
2187 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002188 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2189 VkBool32 multiViewport
2190 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002191 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2192 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2193 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002194 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002195 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002196 VkBool32 vertexPipelineStoresAndAtomics
2197 VkBool32 fragmentStoresAndAtomics
2198 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002199 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2200 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2201 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002202 VkBool32 shaderStorageImageReadWithoutFormat
2203 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002204 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2205 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2206 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2207 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2208 VkBool32 shaderClipDistance /// clip distance in shaders
2209 VkBool32 shaderCullDistance /// cull distance in shaders
2210 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2211 VkBool32 shaderInt64 /// 64-bit integers in shaders
2212 VkBool32 shaderInt16 /// 16-bit integers in shaders
2213 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002214 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002215 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2216 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2217 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2218 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2219 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2220 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2221 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2222 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2223 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002224 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002225 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002226}
2227
2228class VkPhysicalDeviceLimits {
2229 /// resource maximum sizes
2230 u32 maxImageDimension1D /// max 1D image dimension
2231 u32 maxImageDimension2D /// max 2D image dimension
2232 u32 maxImageDimension3D /// max 3D image dimension
2233 u32 maxImageDimensionCube /// max cubemap image dimension
2234 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002235 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002236 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2237 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002238 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2239 /// memory limits
2240 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002241 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002242 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2243 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002244 /// descriptor set limits
2245 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002246 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2247 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2248 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2249 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2250 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002251 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002252 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002253 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2254 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002255 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002256 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002257 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002258 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2259 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002260 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002261 /// vertex stage limits
2262 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002263 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002264 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2265 u32 maxVertexInputBindingStride /// max vertex input binding stride
2266 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2267 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002268 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002269 u32 maxTessellationPatchSize /// max patch size (vertices)
2270 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2271 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2272 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2273 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2274 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2275 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002276 /// geometry stage limits
2277 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2278 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2279 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2280 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2281 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2282 /// fragment stage limits
2283 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002284 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002285 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002286 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2287 /// compute stage limits
2288 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2289 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2290 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2291 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2292
2293 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2294 u32 subTexelPrecisionBits /// num bits of subtexel precision
2295 u32 mipmapPrecisionBits /// num bits of mipmap precision
2296
2297 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002298 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002299
2300 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2301 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2302
2303 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002304 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2305 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2306 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2307
Jesse Halldc6d36c2015-11-29 19:12:15 -08002308 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2309 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2310 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2311 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002312
Jesse Hallfbf97b02015-11-20 14:17:03 -08002313 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002314 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002315 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002316 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2317 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2318 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2319 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2320
2321 u32 maxFramebufferWidth /// max width for a framebuffer
2322 u32 maxFramebufferHeight /// max height for a framebuffer
2323 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002324 VkSampleCountFlags framebufferColorSampleCounts
2325 VkSampleCountFlags framebufferDepthSampleCounts
2326 VkSampleCountFlags framebufferStencilSampleCounts
2327 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002328 u32 maxColorAttachments /// max num of framebuffer color attachments
2329
Jesse Hall091ed9e2015-11-30 00:55:29 -08002330 VkSampleCountFlags sampledImageColorSampleCounts
2331 VkSampleCountFlags sampledImageIntegerSampleCounts
2332 VkSampleCountFlags sampledImageDepthSampleCounts
2333 VkSampleCountFlags sampledImageStencilSampleCounts
2334 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002335 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002336 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002337
Jesse Halla9bb62b2015-11-21 19:31:56 -08002338 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002339
2340 u32 maxClipDistances /// max number of clip distances
2341 u32 maxCullDistances /// max number of cull distances
2342 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2343
Jesse Hallfbf97b02015-11-20 14:17:03 -08002344 u32 discreteQueuePriorities
2345
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002346 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2347 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002348 f32 pointSizeGranularity /// granularity of supported point sizes
2349 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002350 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002351 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002352
Jesse Hall65ab5522015-11-30 00:07:16 -08002353 VkDeviceSize optimalBufferCopyOffsetAlignment
2354 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002355 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002356}
2357
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002358class VkPhysicalDeviceSparseProperties {
2359 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 -08002360 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 -07002361 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2362 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 -07002363 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
2364}
2365
Jesse Halld27f6aa2015-08-15 17:58:48 -07002366class VkSemaphoreCreateInfo {
2367 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2368 const void* pNext /// Pointer to next structure
2369 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2370}
2371
2372class VkQueryPoolCreateInfo {
2373 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2374 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002375 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002376 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002377 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002378 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2379}
2380
2381class VkFramebufferCreateInfo {
2382 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2383 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002384 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002385 VkRenderPass renderPass
2386 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002387 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002388 u32 width
2389 u32 height
2390 u32 layers
2391}
2392
Jesse Hall3fbc8562015-11-29 22:10:52 -08002393class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002394 u32 vertexCount
2395 u32 instanceCount
2396 u32 firstVertex
2397 u32 firstInstance
2398}
2399
Jesse Hall3fbc8562015-11-29 22:10:52 -08002400class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002401 u32 indexCount
2402 u32 instanceCount
2403 u32 firstIndex
2404 s32 vertexOffset
2405 u32 firstInstance
2406}
2407
Jesse Hall3fbc8562015-11-29 22:10:52 -08002408class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002409 u32 x
2410 u32 y
2411 u32 z
2412}
2413
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002414@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002415class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002416 u32 minImageCount
2417 u32 maxImageCount
2418 VkExtent2D currentExtent
2419 VkExtent2D minImageExtent
2420 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002421 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002422 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002423 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002424 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002425 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002426}
2427
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002428@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002429class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002430 VkFormat format
2431 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002432}
2433
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002434@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002435class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002436 VkStructureType sType
2437 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002438 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002439 VkSurfaceKHR surface
2440 u32 minImageCount
2441 VkFormat imageFormat
2442 VkColorSpaceKHR imageColorSpace
2443 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002444 u32 imageArrayLayers
2445 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002446 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002447 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002448 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002449 VkSurfaceTransformFlagBitsKHR preTransform
2450 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002451 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002452 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002453 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002454}
2455
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002456@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002457class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002458 VkStructureType sType
2459 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002460 u32 waitSemaphoreCount
2461 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002462 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002463 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002464 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002465 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002466}
2467
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002468@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002469class VkDisplayPropertiesKHR {
2470 VkDisplayKHR display
2471 const char* displayName
2472 VkExtent2D physicalDimensions
2473 VkExtent2D physicalResolution
2474 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002475 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002476 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002477}
2478
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002479@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002480class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002481 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002482 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002483}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002484
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002485@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002486class VkDisplayModePropertiesKHR {
2487 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002488 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002489}
2490
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002491@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002492class VkDisplayModeCreateInfoKHR {
2493 VkStructureType sType
2494 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002495 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002496 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002497}
2498
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002499@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002500class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002501 VkDisplayKHR currentDisplay
2502 u32 currentStackIndex
2503}
2504
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002505@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002506class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002507 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2508 VkOffset2D minSrcPosition
2509 VkOffset2D maxSrcPosition
2510 VkExtent2D minSrcExtent
2511 VkExtent2D maxSrcExtent
2512 VkOffset2D minDstPosition
2513 VkOffset2D maxDstPosition
2514 VkExtent2D minDstExtent
2515 VkExtent2D maxDstExtent
2516}
2517
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002518@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002519class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002520 VkStructureType sType
2521 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002522 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002523 VkDisplayModeKHR displayMode
2524 u32 planeIndex
2525 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002526 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002527 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002528 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2529 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002530}
2531
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002532@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002533class VkDisplayPresentInfoKHR {
2534 VkStructureType sType
2535 const void* pNext
2536 VkRect2D srcRect
2537 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002538 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002539}
2540
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002541@extension("VK_KHR_xlib_surface")
2542class VkXlibSurfaceCreateInfoKHR {
2543 VkStructureType sType
2544 const void* pNext
2545 VkXlibSurfaceCreateFlagsKHR flags
2546 platform.Display* dpy
2547 platform.Window window
2548}
2549
2550@extension("VK_KHR_xcb_surface")
2551class VkXcbSurfaceCreateInfoKHR {
2552 VkStructureType sType
2553 const void* pNext
2554 VkXcbSurfaceCreateFlagsKHR flags
2555 platform.xcb_connection_t* connection
2556 platform.xcb_window_t window
2557}
2558
2559@extension("VK_KHR_wayland_surface")
2560class VkWaylandSurfaceCreateInfoKHR {
2561 VkStructureType sType
2562 const void* pNext
2563 VkWaylandSurfaceCreateFlagsKHR flags
2564 platform.wl_display* display
2565 platform.wl_surface* surface
2566}
2567
2568@extension("VK_KHR_mir_surface")
2569class VkMirSurfaceCreateInfoKHR {
2570 VkStructureType sType
2571 const void* pNext
2572 VkMirSurfaceCreateFlagsKHR flags
2573 platform.MirConnection* connection
2574 platform.MirSurface* mirSurface
2575}
2576
2577@extension("VK_KHR_android_surface")
2578class VkAndroidSurfaceCreateInfoKHR {
2579 VkStructureType sType
2580 const void* pNext
2581 VkAndroidSurfaceCreateFlagsKHR flags
2582 platform.ANativeWindow* window
2583}
2584
2585@extension("VK_KHR_win32_surface")
2586class VkWin32SurfaceCreateInfoKHR {
2587 VkStructureType sType
2588 const void* pNext
2589 VkWin32SurfaceCreateFlagsKHR flags
2590 platform.HINSTANCE hinstance
2591 platform.HWND hwnd
2592}
2593
Jesse Hall715b86a2016-01-16 16:34:29 -08002594@extension("VK_EXT_debug_report")
2595class VkDebugReportCallbackCreateInfoEXT {
2596 VkStructureType sType
2597 const void* pNext
2598 VkDebugReportFlagsEXT flags
2599 PFN_vkDebugReportCallbackEXT pfnCallback
2600 void* pUserData
2601}
2602
Jesse Hall1356b0d2015-11-23 17:24:58 -08002603
Jesse Halld27f6aa2015-08-15 17:58:48 -07002604////////////////
2605// Commands //
2606////////////////
2607
2608// Function pointers. TODO: add support for function pointers.
2609
2610@external type void* PFN_vkVoidFunction
2611@pfn cmd void vkVoidFunction() {
2612}
2613
Jesse Hall3fbc8562015-11-29 22:10:52 -08002614@external type void* PFN_vkAllocationFunction
2615@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002616 void* pUserData,
2617 platform.size_t size,
2618 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002619 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002620 return ?
2621}
2622
Jesse Hall3fbc8562015-11-29 22:10:52 -08002623@external type void* PFN_vkReallocationFunction
2624@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002625 void* pUserData,
2626 void* pOriginal,
2627 platform.size_t size,
2628 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002629 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002630 return ?
2631}
2632
2633@external type void* PFN_vkFreeFunction
2634@pfn cmd void vkFreeFunction(
2635 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002636 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002637}
2638
Jesse Hall3fbc8562015-11-29 22:10:52 -08002639@external type void* PFN_vkInternalAllocationNotification
2640@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002641 void* pUserData,
2642 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002643 VkInternalAllocationType allocationType,
2644 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002645}
2646
2647@external type void* PFN_vkInternalFreeNotification
2648@pfn cmd void vkInternalFreeNotification(
2649 void* pUserData,
2650 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002651 VkInternalAllocationType allocationType,
2652 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002653}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002654
2655// Global functions
2656
2657@threadSafety("system")
2658cmd VkResult vkCreateInstance(
2659 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002660 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002661 VkInstance* pInstance) {
2662 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
2663
2664 instance := ?
2665 pInstance[0] = instance
2666 State.Instances[instance] = new!InstanceObject()
2667
Jesse Hall3dd678a2016-01-08 21:52:01 -08002668 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
2669 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07002670
2671 return ?
2672}
2673
2674@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002675cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002676 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002677 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002678 instanceObject := GetInstance(instance)
2679
2680 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002681}
2682
2683@threadSafety("system")
2684cmd VkResult vkEnumeratePhysicalDevices(
2685 VkInstance instance,
2686 u32* pPhysicalDeviceCount,
2687 VkPhysicalDevice* pPhysicalDevices) {
2688 instanceObject := GetInstance(instance)
2689
2690 physicalDeviceCount := as!u32(?)
2691 pPhysicalDeviceCount[0] = physicalDeviceCount
2692 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
2693
2694 for i in (0 .. physicalDeviceCount) {
2695 physicalDevice := ?
2696 physicalDevices[i] = physicalDevice
2697 if !(physicalDevice in State.PhysicalDevices) {
2698 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
2699 }
2700 }
2701
2702 return ?
2703}
2704
2705cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
2706 VkDevice device,
2707 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002708 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002709 device := GetDevice(device)
2710 }
2711
2712 return ?
2713}
2714
2715cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
2716 VkInstance instance,
2717 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002718 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002719 instanceObject := GetInstance(instance)
2720 }
2721
2722 return ?
2723}
2724
Jesse Hall606a54e2015-11-19 22:17:28 -08002725cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002726 VkPhysicalDevice physicalDevice,
2727 VkPhysicalDeviceProperties* pProperties) {
2728 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2729
2730 properties := ?
2731 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002732}
2733
Jesse Hall606a54e2015-11-19 22:17:28 -08002734cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002735 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002736 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002737 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002738 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002739 // TODO: Figure out how to express fetch-count-or-properties
2740 // This version fails 'apic validate' with 'fence not allowed in
2741 // *semantic.Branch'. Other attempts have failed with the same or other
2742 // errors.
2743 // if pQueueFamilyProperties != null {
2744 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
2745 // for i in (0 .. pCount[0]) {
2746 // queueProperties := as!VkQueueFamilyProperties(?)
2747 // queuesProperties[i] = queueProperties
2748 // }
2749 // } else {
2750 // count := ?
2751 // pCount[0] = count
2752 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002753}
2754
Jesse Hall606a54e2015-11-19 22:17:28 -08002755cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002756 VkPhysicalDevice physicalDevice,
2757 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
2758 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2759
2760 memoryProperties := ?
2761 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002762}
2763
Jesse Hall606a54e2015-11-19 22:17:28 -08002764cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002765 VkPhysicalDevice physicalDevice,
2766 VkPhysicalDeviceFeatures* pFeatures) {
2767 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2768
2769 features := ?
2770 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07002771}
2772
Jesse Hall606a54e2015-11-19 22:17:28 -08002773cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002774 VkPhysicalDevice physicalDevice,
2775 VkFormat format,
2776 VkFormatProperties* pFormatProperties) {
2777 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2778
2779 formatProperties := ?
2780 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002781}
2782
Jesse Halla9e57032015-11-30 01:03:10 -08002783cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002784 VkPhysicalDevice physicalDevice,
2785 VkFormat format,
2786 VkImageType type,
2787 VkImageTiling tiling,
2788 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002789 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002790 VkImageFormatProperties* pImageFormatProperties) {
2791 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2792
2793 imageFormatProperties := ?
2794 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08002795
2796 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07002797}
2798
Jesse Halld27f6aa2015-08-15 17:58:48 -07002799
2800// Device functions
2801
2802@threadSafety("system")
2803cmd VkResult vkCreateDevice(
2804 VkPhysicalDevice physicalDevice,
2805 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002806 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002807 VkDevice* pDevice) {
2808 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
2809 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2810
2811 device := ?
2812 pDevice[0] = device
2813 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
2814
2815 return ?
2816}
2817
2818@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002819cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002820 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002821 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002822 deviceObject := GetDevice(device)
2823
2824 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002825}
2826
2827
2828// Extension discovery functions
2829
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002830cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002831 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002832 VkLayerProperties* pProperties) {
2833 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002834 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002835
2836 properties := pProperties[0:count]
2837 for i in (0 .. count) {
2838 property := ?
2839 properties[i] = property
2840 }
2841
2842 return ?
2843}
2844
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002845cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002846 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002847 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002848 VkExtensionProperties* pProperties) {
2849 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002850 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002851
2852 properties := pProperties[0:count]
2853 for i in (0 .. count) {
2854 property := ?
2855 properties[i] = property
2856 }
2857
2858 return ?
2859}
2860
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002861cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002862 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002863 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002864 VkLayerProperties* pProperties) {
2865 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2866 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002867 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002868
2869 properties := pProperties[0:count]
2870 for i in (0 .. count) {
2871 property := ?
2872 properties[i] = property
2873 }
2874
2875 return ?
2876}
2877
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002878cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002879 VkPhysicalDevice physicalDevice,
2880 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002881 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002882 VkExtensionProperties* pProperties) {
2883 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2884
2885 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002886 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002887
2888 properties := pProperties[0:count]
2889 for i in (0 .. count) {
2890 property := ?
2891 properties[i] = property
2892 }
2893
2894 return ?
2895}
2896
2897
2898// Queue functions
2899
2900@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08002901cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002902 VkDevice device,
2903 u32 queueFamilyIndex,
2904 u32 queueIndex,
2905 VkQueue* pQueue) {
2906 deviceObject := GetDevice(device)
2907
2908 queue := ?
2909 pQueue[0] = queue
2910
2911 if !(queue in State.Queues) {
2912 State.Queues[queue] = new!QueueObject(device: device)
2913 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002914}
2915
2916@threadSafety("app")
2917cmd VkResult vkQueueSubmit(
2918 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08002919 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08002920 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002921 VkFence fence) {
2922 queueObject := GetQueue(queue)
2923
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002924 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002925 fenceObject := GetFence(fence)
2926 assert(fenceObject.device == queueObject.device)
2927 }
2928
Jesse Hall3fbc8562015-11-29 22:10:52 -08002929 // commandBuffers := pcommandBuffers[0:commandBufferCount]
2930 // for i in (0 .. commandBufferCount) {
2931 // commandBuffer := commandBuffers[i]
2932 // commandBufferObject := GetCommandBuffer(commandBuffer)
2933 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08002934 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08002935 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
2936 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08002937 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002938
2939 return ?
2940}
2941
2942@threadSafety("system")
2943cmd VkResult vkQueueWaitIdle(
2944 VkQueue queue) {
2945 queueObject := GetQueue(queue)
2946
2947 return ?
2948}
2949
2950@threadSafety("system")
2951cmd VkResult vkDeviceWaitIdle(
2952 VkDevice device) {
2953 deviceObject := GetDevice(device)
2954
2955 return ?
2956}
2957
2958
2959// Memory functions
2960
2961@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002962cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002963 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002964 const VkMemoryAllocateInfo* pAllocateInfo,
2965 const VkAllocationCallbacks* pAllocator,
2966 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002967 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002968 deviceObject := GetDevice(device)
2969
Jesse Hall3fbc8562015-11-29 22:10:52 -08002970 memory := ?
2971 pMemory[0] = memory
2972 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002973 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002974 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002975
2976 return ?
2977}
2978
2979@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002980cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002981 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002982 VkDeviceMemory memory,
2983 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002984 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002985 memoryObject := GetDeviceMemory(memory)
2986 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002987
2988 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08002989 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002990 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002991 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
2992 "vkFreeMemory: commandBuffers still bound")
2993 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002994}
2995
2996@threadSafety("app")
2997cmd VkResult vkMapMemory(
2998 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002999 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003000 VkDeviceSize offset,
3001 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003002 VkMemoryMapFlags flags,
3003 void** ppData) {
3004 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003005 memoryObject := GetDeviceMemory(memory)
3006 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003007
3008 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003009 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003010
3011 return ?
3012}
3013
3014@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003015cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003016 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003017 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003018 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003019 memoryObject := GetDeviceMemory(memory)
3020 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003021}
3022
3023cmd VkResult vkFlushMappedMemoryRanges(
3024 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003025 u32 memoryRangeCount
3026 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003027 deviceObject := GetDevice(device)
3028
Jesse Hall3fbc8562015-11-29 22:10:52 -08003029 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3030 for i in (0 .. memoryRangeCount) {
3031 memoryRange := memoryRanges[i]
3032 memoryObject := GetDeviceMemory(memoryRange.memory)
3033 assert(memoryObject.device == device)
3034 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003035 }
3036
3037 return ?
3038}
3039
3040cmd VkResult vkInvalidateMappedMemoryRanges(
3041 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003042 u32 memoryRangeCount,
3043 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003044 deviceObject := GetDevice(device)
3045
Jesse Hall3fbc8562015-11-29 22:10:52 -08003046 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3047 for i in (0 .. memoryRangeCount) {
3048 memoryRange := memoryRanges[i]
3049 memoryObject := GetDeviceMemory(memoryRange.memory)
3050 assert(memoryObject.device == device)
3051 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003052 }
3053
3054 return ?
3055}
3056
3057
3058// Memory management API functions
3059
Jesse Hall606a54e2015-11-19 22:17:28 -08003060cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003061 VkDevice device,
3062 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003063 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003064 deviceObject := GetDevice(device)
3065
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003066 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003067 memoryObject := GetDeviceMemory(memory)
3068 assert(memoryObject.device == device)
3069 }
3070
3071 committedMemoryInBytes := ?
3072 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003073}
3074
Jesse Hall606a54e2015-11-19 22:17:28 -08003075cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003076 VkDevice device,
3077 VkBuffer buffer,
3078 VkMemoryRequirements* pMemoryRequirements) {
3079 deviceObject := GetDevice(device)
3080 bufferObject := GetBuffer(buffer)
3081 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003082}
3083
3084cmd VkResult vkBindBufferMemory(
3085 VkDevice device,
3086 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003087 VkDeviceMemory memory,
3088 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003089 deviceObject := GetDevice(device)
3090 bufferObject := GetBuffer(buffer)
3091 assert(bufferObject.device == device)
3092
3093 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003094 if bufferObject.memory != NULL_HANDLE {
3095 memoryObject := GetDeviceMemory(bufferObject.memory)
3096 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003097 }
3098
3099 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003100 if memory != NULL_HANDLE {
3101 memoryObject := GetDeviceMemory(memory)
3102 assert(memoryObject.device == device)
3103 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003104 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003105 bufferObject.memory = memory
3106 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003107
3108 return ?
3109}
3110
Jesse Hall606a54e2015-11-19 22:17:28 -08003111cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003112 VkDevice device,
3113 VkImage image,
3114 VkMemoryRequirements* pMemoryRequirements) {
3115 deviceObject := GetDevice(device)
3116 imageObject := GetImage(image)
3117 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003118}
3119
3120cmd VkResult vkBindImageMemory(
3121 VkDevice device,
3122 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003123 VkDeviceMemory memory,
3124 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003125 deviceObject := GetDevice(device)
3126 imageObject := GetImage(image)
3127 assert(imageObject.device == device)
3128
3129 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003130 if imageObject.memory != NULL_HANDLE {
3131 memoryObject := GetDeviceMemory(imageObject.memory)
3132 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003133 }
3134
3135 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003136 if memory != NULL_HANDLE {
3137 memoryObject := GetDeviceMemory(memory)
3138 assert(memoryObject.device == device)
3139 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003140 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003141 imageObject.memory = memory
3142 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003143
3144 return ?
3145}
3146
Jesse Hall606a54e2015-11-19 22:17:28 -08003147cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003148 VkDevice device,
3149 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003150 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003151 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3152 deviceObject := GetDevice(device)
3153 imageObject := GetImage(image)
3154 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003155}
3156
Jesse Hall606a54e2015-11-19 22:17:28 -08003157cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003158 VkPhysicalDevice physicalDevice,
3159 VkFormat format,
3160 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003161 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003162 VkImageUsageFlags usage,
3163 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003164 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003165 VkSparseImageFormatProperties* pProperties) {
3166 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003167}
3168
Jesse Halla6429252015-11-29 18:59:42 -08003169cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003170 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003171 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003172 const VkBindSparseInfo* pBindInfo,
3173 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003174 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003175
3176 return ?
3177}
3178
3179
3180// Fence functions
3181
3182@threadSafety("system")
3183cmd VkResult vkCreateFence(
3184 VkDevice device,
3185 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003186 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003187 VkFence* pFence) {
3188 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3189 deviceObject := GetDevice(device)
3190
3191 fence := ?
3192 pFence[0] = fence
3193 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003194 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003195
3196 return ?
3197}
3198
3199@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003200cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003201 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003202 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003203 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003204 deviceObject := GetDevice(device)
3205 fenceObject := GetFence(fence)
3206 assert(fenceObject.device == device)
3207
3208 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003209}
3210
3211@threadSafety("system")
3212cmd VkResult vkResetFences(
3213 VkDevice device,
3214 u32 fenceCount,
3215 const VkFence* pFences) {
3216 deviceObject := GetDevice(device)
3217
3218 fences := pFences[0:fenceCount]
3219 for i in (0 .. fenceCount) {
3220 fence := fences[i]
3221 fenceObject := GetFence(fence)
3222 assert(fenceObject.device == device)
3223 fenceObject.signaled = false
3224 }
3225
3226 return ?
3227}
3228
3229@threadSafety("system")
3230cmd VkResult vkGetFenceStatus(
3231 VkDevice device,
3232 VkFence fence) {
3233 deviceObject := GetDevice(device)
3234 fenceObject := GetFence(fence)
3235 assert(fenceObject.device == device)
3236
3237 return ?
3238}
3239
3240@threadSafety("system")
3241cmd VkResult vkWaitForFences(
3242 VkDevice device,
3243 u32 fenceCount,
3244 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003245 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003246 u64 timeout) { /// timeout in nanoseconds
3247 deviceObject := GetDevice(device)
3248
3249 fences := pFences[0:fenceCount]
3250 for i in (0 .. fenceCount) {
3251 fence := fences[i]
3252 fenceObject := GetFence(fence)
3253 assert(fenceObject.device == device)
3254 }
3255
3256 return ?
3257}
3258
3259
3260// Queue semaphore functions
3261
3262@threadSafety("system")
3263cmd VkResult vkCreateSemaphore(
3264 VkDevice device,
3265 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003266 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003267 VkSemaphore* pSemaphore) {
3268 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3269 deviceObject := GetDevice(device)
3270
3271 semaphore := ?
3272 pSemaphore[0] = semaphore
3273 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3274
3275 return ?
3276}
3277
3278@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003279cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003280 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003281 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003282 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003283 deviceObject := GetDevice(device)
3284 semaphoreObject := GetSemaphore(semaphore)
3285 assert(semaphoreObject.device == device)
3286
3287 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003288}
3289
Jesse Halld27f6aa2015-08-15 17:58:48 -07003290
3291// Event functions
3292
3293@threadSafety("system")
3294cmd VkResult vkCreateEvent(
3295 VkDevice device,
3296 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003297 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003298 VkEvent* pEvent) {
3299 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3300 deviceObject := GetDevice(device)
3301
3302 event := ?
3303 pEvent[0] = event
3304 State.Events[event] = new!EventObject(device: device)
3305
3306 return ?
3307}
3308
3309@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003310cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003311 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003312 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003313 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003314 deviceObject := GetDevice(device)
3315 eventObject := GetEvent(event)
3316 assert(eventObject.device == device)
3317
3318 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003319}
3320
3321@threadSafety("system")
3322cmd VkResult vkGetEventStatus(
3323 VkDevice device,
3324 VkEvent event) {
3325 deviceObject := GetDevice(device)
3326 eventObject := GetEvent(event)
3327 assert(eventObject.device == device)
3328
3329 return ?
3330}
3331
3332@threadSafety("system")
3333cmd VkResult vkSetEvent(
3334 VkDevice device,
3335 VkEvent event) {
3336 deviceObject := GetDevice(device)
3337 eventObject := GetEvent(event)
3338 assert(eventObject.device == device)
3339
3340 return ?
3341}
3342
3343@threadSafety("system")
3344cmd VkResult vkResetEvent(
3345 VkDevice device,
3346 VkEvent event) {
3347 deviceObject := GetDevice(device)
3348 eventObject := GetEvent(event)
3349 assert(eventObject.device == device)
3350
3351 return ?
3352}
3353
3354
3355// Query functions
3356
3357@threadSafety("system")
3358cmd VkResult vkCreateQueryPool(
3359 VkDevice device,
3360 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003361 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003362 VkQueryPool* pQueryPool) {
3363 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3364 deviceObject := GetDevice(device)
3365
3366 queryPool := ?
3367 pQueryPool[0] = queryPool
3368 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3369
3370 return ?
3371}
3372
3373@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003374cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003375 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003376 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003377 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003378 deviceObject := GetDevice(device)
3379 queryPoolObject := GetQueryPool(queryPool)
3380 assert(queryPoolObject.device == device)
3381
3382 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003383}
3384
3385@threadSafety("system")
3386cmd VkResult vkGetQueryPoolResults(
3387 VkDevice device,
3388 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003389 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003390 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003391 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003392 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003393 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003394 VkQueryResultFlags flags) {
3395 deviceObject := GetDevice(device)
3396 queryPoolObject := GetQueryPool(queryPool)
3397 assert(queryPoolObject.device == device)
3398
Jesse Halld27f6aa2015-08-15 17:58:48 -07003399 data := pData[0:dataSize]
3400
3401 return ?
3402}
3403
3404// Buffer functions
3405
3406@threadSafety("system")
3407cmd VkResult vkCreateBuffer(
3408 VkDevice device,
3409 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003410 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003411 VkBuffer* pBuffer) {
3412 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3413 deviceObject := GetDevice(device)
3414
3415 buffer := ?
3416 pBuffer[0] = buffer
3417 State.Buffers[buffer] = new!BufferObject(device: device)
3418
3419 return ?
3420}
3421
3422@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003423cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003424 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003425 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003426 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003427 deviceObject := GetDevice(device)
3428 bufferObject := GetBuffer(buffer)
3429 assert(bufferObject.device == device)
3430
Jesse Hall3fbc8562015-11-29 22:10:52 -08003431 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003432 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003433}
3434
3435
3436// Buffer view functions
3437
3438@threadSafety("system")
3439cmd VkResult vkCreateBufferView(
3440 VkDevice device,
3441 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003442 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003443 VkBufferView* pView) {
3444 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3445 deviceObject := GetDevice(device)
3446
3447 bufferObject := GetBuffer(pCreateInfo.buffer)
3448 assert(bufferObject.device == device)
3449
3450 view := ?
3451 pView[0] = view
3452 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3453
3454 return ?
3455}
3456
3457@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003458cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003459 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003460 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003461 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003462 deviceObject := GetDevice(device)
3463 bufferViewObject := GetBufferView(bufferView)
3464 assert(bufferViewObject.device == device)
3465
3466 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003467}
3468
3469
3470// Image functions
3471
3472@threadSafety("system")
3473cmd VkResult vkCreateImage(
3474 VkDevice device,
3475 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003476 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003477 VkImage* pImage) {
3478 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3479 deviceObject := GetDevice(device)
3480
3481 image := ?
3482 pImage[0] = image
3483 State.Images[image] = new!ImageObject(device: device)
3484
3485 return ?
3486}
3487
3488@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003489cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003490 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003491 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003492 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003493 deviceObject := GetDevice(device)
3494 imageObject := GetImage(image)
3495 assert(imageObject.device == device)
3496
Jesse Hall3fbc8562015-11-29 22:10:52 -08003497 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003498 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003499}
3500
Jesse Hall606a54e2015-11-19 22:17:28 -08003501cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003502 VkDevice device,
3503 VkImage image,
3504 const VkImageSubresource* pSubresource,
3505 VkSubresourceLayout* pLayout) {
3506 deviceObject := GetDevice(device)
3507 imageObject := GetImage(image)
3508 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003509}
3510
3511
3512// Image view functions
3513
3514@threadSafety("system")
3515cmd VkResult vkCreateImageView(
3516 VkDevice device,
3517 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003518 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003519 VkImageView* pView) {
3520 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
3521 deviceObject := GetDevice(device)
3522
3523 imageObject := GetImage(pCreateInfo.image)
3524 assert(imageObject.device == device)
3525
3526 view := ?
3527 pView[0] = view
3528 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
3529
3530 return ?
3531}
3532
3533@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003534cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003535 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003536 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003537 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003538 deviceObject := GetDevice(device)
3539 imageViewObject := GetImageView(imageView)
3540 assert(imageViewObject.device == device)
3541
3542 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003543}
3544
3545
3546// Shader functions
3547
3548cmd VkResult vkCreateShaderModule(
3549 VkDevice device,
3550 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003551 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003552 VkShaderModule* pShaderModule) {
3553 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
3554 deviceObject := GetDevice(device)
3555
3556 shaderModule := ?
3557 pShaderModule[0] = shaderModule
3558 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
3559
3560 return ?
3561}
3562
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003563cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003564 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003565 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003566 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003567 deviceObject := GetDevice(device)
3568 shaderModuleObject := GetShaderModule(shaderModule)
3569 assert(shaderModuleObject.device == device)
3570
3571 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003572}
3573
Jesse Halld27f6aa2015-08-15 17:58:48 -07003574
3575// Pipeline functions
3576
3577cmd VkResult vkCreatePipelineCache(
3578 VkDevice device,
3579 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003580 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003581 VkPipelineCache* pPipelineCache) {
3582 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
3583 deviceObject := GetDevice(device)
3584
3585 pipelineCache := ?
3586 pPipelineCache[0] = pipelineCache
3587 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
3588
3589 return ?
3590}
3591
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003592cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003593 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003594 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003595 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003596 deviceObject := GetDevice(device)
3597 pipelineCacheObject := GetPipelineCache(pipelineCache)
3598 assert(pipelineCacheObject.device == device)
3599
3600 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003601}
3602
Jesse Halld27f6aa2015-08-15 17:58:48 -07003603cmd VkResult vkGetPipelineCacheData(
3604 VkDevice device,
3605 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003606 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003607 void* pData) {
3608 deviceObject := GetDevice(device)
3609 pipelineCacheObject := GetPipelineCache(pipelineCache)
3610 assert(pipelineCacheObject.device == device)
3611
3612 return ?
3613}
3614
3615cmd VkResult vkMergePipelineCaches(
3616 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003617 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003618 u32 srcCacheCount,
3619 const VkPipelineCache* pSrcCaches) {
3620 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003621 dstCacheObject := GetPipelineCache(dstCache)
3622 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003623
3624 srcCaches := pSrcCaches[0:srcCacheCount]
3625 for i in (0 .. srcCacheCount) {
3626 srcCache := srcCaches[i]
3627 srcCacheObject := GetPipelineCache(srcCache)
3628 assert(srcCacheObject.device == device)
3629 }
3630
3631 return ?
3632}
3633
3634cmd VkResult vkCreateGraphicsPipelines(
3635 VkDevice device,
3636 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003637 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003638 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003639 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003640 VkPipeline* pPipelines) {
3641 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003642 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003643 pipelineCacheObject := GetPipelineCache(pipelineCache)
3644 assert(pipelineCacheObject.device == device)
3645 }
3646
Jesse Hall03b6fe12015-11-24 12:44:21 -08003647 createInfos := pCreateInfos[0:createInfoCount]
3648 pipelines := pPipelines[0:createInfoCount]
3649 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003650 pipeline := ?
3651 pipelines[i] = pipeline
3652 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3653 }
3654
3655 return ?
3656}
3657
3658cmd VkResult vkCreateComputePipelines(
3659 VkDevice device,
3660 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003661 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003662 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003663 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003664 VkPipeline* pPipelines) {
3665 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003666 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003667 pipelineCacheObject := GetPipelineCache(pipelineCache)
3668 assert(pipelineCacheObject.device == device)
3669 }
3670
Jesse Hall03b6fe12015-11-24 12:44:21 -08003671 createInfos := pCreateInfos[0:createInfoCount]
3672 pipelines := pPipelines[0:createInfoCount]
3673 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003674 pipeline := ?
3675 pipelines[i] = pipeline
3676 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3677 }
3678
3679 return ?
3680}
3681
3682@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003683cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003684 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003685 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003686 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003687 deviceObject := GetDevice(device)
3688 pipelineObjects := GetPipeline(pipeline)
3689 assert(pipelineObjects.device == device)
3690
3691 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003692}
3693
3694
3695// Pipeline layout functions
3696
3697@threadSafety("system")
3698cmd VkResult vkCreatePipelineLayout(
3699 VkDevice device,
3700 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003701 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003702 VkPipelineLayout* pPipelineLayout) {
3703 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
3704 deviceObject := GetDevice(device)
3705
3706 pipelineLayout := ?
3707 pPipelineLayout[0] = pipelineLayout
3708 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
3709
3710 return ?
3711}
3712
3713@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003714cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003715 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003716 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003717 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003718 deviceObject := GetDevice(device)
3719 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
3720 assert(pipelineLayoutObjects.device == device)
3721
3722 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003723}
3724
3725
3726// Sampler functions
3727
3728@threadSafety("system")
3729cmd VkResult vkCreateSampler(
3730 VkDevice device,
3731 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003732 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003733 VkSampler* pSampler) {
3734 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
3735 deviceObject := GetDevice(device)
3736
3737 sampler := ?
3738 pSampler[0] = sampler
3739 State.Samplers[sampler] = new!SamplerObject(device: device)
3740
3741 return ?
3742}
3743
3744@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003745cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003746 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003747 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003748 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003749 deviceObject := GetDevice(device)
3750 samplerObject := GetSampler(sampler)
3751 assert(samplerObject.device == device)
3752
3753 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003754}
3755
3756
3757// Descriptor set functions
3758
3759@threadSafety("system")
3760cmd VkResult vkCreateDescriptorSetLayout(
3761 VkDevice device,
3762 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003763 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003764 VkDescriptorSetLayout* pSetLayout) {
3765 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
3766 deviceObject := GetDevice(device)
3767
3768 setLayout := ?
3769 pSetLayout[0] = setLayout
3770 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
3771
3772 return ?
3773}
3774
3775@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003776cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003777 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003778 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003779 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780 deviceObject := GetDevice(device)
3781 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
3782 assert(descriptorSetLayoutObject.device == device)
3783
3784 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003785}
3786
3787@threadSafety("system")
3788cmd VkResult vkCreateDescriptorPool(
3789 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003790 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003791 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003792 VkDescriptorPool* pDescriptorPool) {
3793 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
3794 deviceObject := GetDevice(device)
3795
3796 descriptorPool := ?
3797 pDescriptorPool[0] = descriptorPool
3798 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
3799
3800 return ?
3801}
3802
3803@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003804cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003805 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003806 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003807 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003808 deviceObject := GetDevice(device)
3809 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3810 assert(descriptorPoolObject.device == device)
3811
3812 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003813}
3814
3815@threadSafety("app")
3816cmd VkResult vkResetDescriptorPool(
3817 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08003818 VkDescriptorPool descriptorPool,
3819 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003820 deviceObject := GetDevice(device)
3821 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3822 assert(descriptorPoolObject.device == device)
3823
3824 return ?
3825}
3826
3827@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003828cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003829 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003830 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003831 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003832 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003833 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003834 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003835
Jesse Hall03b6fe12015-11-24 12:44:21 -08003836 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
3837 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003838 setLayout := setLayouts[i]
3839 setLayoutObject := GetDescriptorSetLayout(setLayout)
3840 assert(setLayoutObject.device == device)
3841 }
3842
Jesse Hall03b6fe12015-11-24 12:44:21 -08003843 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
3844 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003845 descriptorSet := ?
3846 descriptorSets[i] = descriptorSet
3847 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
3848 }
3849
3850 return ?
3851}
3852
Jesse Hallf09c6b12015-08-15 19:54:28 -07003853cmd VkResult vkFreeDescriptorSets(
3854 VkDevice device,
3855 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003856 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07003857 const VkDescriptorSet* pDescriptorSets) {
3858 deviceObject := GetDevice(device)
3859 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3860
Jesse Hall03b6fe12015-11-24 12:44:21 -08003861 descriptorSets := pDescriptorSets[0:descriptorSetCount]
3862 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07003863 descriptorSet := descriptorSets[i]
3864 descriptorSetObject := GetDescriptorSet(descriptorSet)
3865 assert(descriptorSetObject.device == device)
3866 State.DescriptorSets[descriptorSet] = null
3867 }
3868
3869 return ?
3870}
3871
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003872cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003873 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08003874 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003875 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08003876 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003877 const VkCopyDescriptorSet* pDescriptorCopies) {
3878 deviceObject := GetDevice(device)
3879
Jesse Hallb00daad2015-11-29 19:46:20 -08003880 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
3881 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003882 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003883 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003884 assert(descriptorWriteObject.device == device)
3885 }
3886
Jesse Hallb00daad2015-11-29 19:46:20 -08003887 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
3888 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003889 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003890 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003891 assert(descriptorCopyObject.device == device)
3892 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003893}
3894
3895
3896// Framebuffer functions
3897
3898@threadSafety("system")
3899cmd VkResult vkCreateFramebuffer(
3900 VkDevice device,
3901 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003902 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003903 VkFramebuffer* pFramebuffer) {
3904 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
3905 deviceObject := GetDevice(device)
3906
3907 framebuffer := ?
3908 pFramebuffer[0] = framebuffer
3909 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
3910
3911 return ?
3912}
3913
3914@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003915cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003916 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003917 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003918 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003919 deviceObject := GetDevice(device)
3920 framebufferObject := GetFramebuffer(framebuffer)
3921 assert(framebufferObject.device == device)
3922
3923 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003924}
3925
3926
3927// Renderpass functions
3928
3929@threadSafety("system")
3930cmd VkResult vkCreateRenderPass(
3931 VkDevice device,
3932 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003933 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003934 VkRenderPass* pRenderPass) {
3935 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
3936 deviceObject := GetDevice(device)
3937
3938 renderpass := ?
3939 pRenderPass[0] = renderpass
3940 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
3941
3942 return ?
3943}
3944
3945@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003946cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003947 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003948 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003949 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003950 deviceObject := GetDevice(device)
3951 renderPassObject := GetRenderPass(renderPass)
3952 assert(renderPassObject.device == device)
3953
3954 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003955}
3956
Jesse Hall606a54e2015-11-19 22:17:28 -08003957cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003958 VkDevice device,
3959 VkRenderPass renderPass,
3960 VkExtent2D* pGranularity) {
3961 deviceObject := GetDevice(device)
3962 renderPassObject := GetRenderPass(renderPass)
3963
3964 granularity := ?
3965 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07003966}
3967
3968// Command pool functions
3969
3970cmd VkResult vkCreateCommandPool(
3971 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003972 const VkCommandPoolCreateInfo* pCreateInfo,
3973 const VkAllocationCallbacks* pAllocator,
3974 VkCommandPool* pCommandPool) {
3975 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003976 deviceObject := GetDevice(device)
3977
Jesse Hall3fbc8562015-11-29 22:10:52 -08003978 commandPool := ?
3979 pCommandPool[0] = commandPool
3980 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003981
3982 return ?
3983}
3984
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003985cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003986 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003987 VkCommandPool commandPool,
3988 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003989 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003990 commandPoolObject := GetCommandPool(commandPool)
3991 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003992
Jesse Hall3fbc8562015-11-29 22:10:52 -08003993 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003994}
3995
3996cmd VkResult vkResetCommandPool(
3997 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003998 VkCommandPool commandPool,
3999 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004000 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004001 commandPoolObject := GetCommandPool(commandPool)
4002 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004003
4004 return ?
4005}
4006
4007// Command buffer functions
4008
Jesse Hall3fbc8562015-11-29 22:10:52 -08004009macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4010 memoryObject := GetDeviceMemory(memory)
4011 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004012
Jesse Hall3fbc8562015-11-29 22:10:52 -08004013 commandBufferObject := GetCommandBuffer(commandBuffer)
4014 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004015}
4016
Jesse Hall3fbc8562015-11-29 22:10:52 -08004017macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4018 memoryObject := GetDeviceMemory(memory)
4019 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004020
Jesse Hall3fbc8562015-11-29 22:10:52 -08004021 commandBufferObject := GetCommandBuffer(commandBuffer)
4022 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004023}
4024
4025@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004026cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004027 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004028 const VkCommandBufferAllocateInfo* pAllocateInfo,
4029 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004030 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004031
Jesse Hall3dd678a2016-01-08 21:52:01 -08004032 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004033 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004034 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004035 commandBuffer := ?
4036 commandBuffers[i] = commandBuffer
4037 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004038 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004039
4040 return ?
4041}
4042
4043@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004044cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004045 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004046 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004047 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004048 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004049 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004050
Jesse Hall3fbc8562015-11-29 22:10:52 -08004051 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004052 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004053 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4054 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004055 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004056 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004057 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004058}
4059
4060@threadSafety("app")
4061cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004062 VkCommandBuffer commandBuffer,
4063 const VkCommandBufferBeginInfo* pBeginInfo) {
4064 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4065 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004066
4067 // TODO: iterate over boundObjects and clear memory bindings
4068
4069 return ?
4070}
4071
4072@threadSafety("app")
4073cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004074 VkCommandBuffer commandBuffer) {
4075 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004076
4077 return ?
4078}
4079
4080@threadSafety("app")
4081cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004082 VkCommandBuffer commandBuffer,
4083 VkCommandBufferResetFlags flags) {
4084 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004085
4086 // TODO: iterate over boundObjects and clear memory bindings
4087
4088 return ?
4089}
4090
4091
4092// Command buffer building functions
4093
4094@threadSafety("app")
4095cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004096 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004097 VkPipelineBindPoint pipelineBindPoint,
4098 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004099 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004100 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004101 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004102
Jesse Halld8bade02015-11-24 10:24:18 -08004103 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004104 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4105 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4106 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004107 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004108}
4109
4110@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004111cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004112 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004113 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004114 u32 viewportCount,
4115 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004116 commandBufferObject := GetCommandBuffer(commandBuffer)
4117 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004118}
4119
4120@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004121cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004122 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004123 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004124 u32 scissorCount,
4125 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004126 commandBufferObject := GetCommandBuffer(commandBuffer)
4127 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004128}
4129
4130@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004131cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004132 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004133 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004134 commandBufferObject := GetCommandBuffer(commandBuffer)
4135 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004136}
4137
4138@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004139cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004140 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004141 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004142 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004143 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004144 commandBufferObject := GetCommandBuffer(commandBuffer)
4145 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004146}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004147
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004148@threadSafety("app")
4149cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004150 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004151 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4152 // an annotation as a quick hack to pass this to the template without
4153 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004154 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004155 commandBufferObject := GetCommandBuffer(commandBuffer)
4156 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004157}
4158
4159@threadSafety("app")
4160cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004161 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004162 f32 minDepthBounds,
4163 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004164 commandBufferObject := GetCommandBuffer(commandBuffer)
4165 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004166}
4167
4168@threadSafety("app")
4169cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004170 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004171 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004172 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004173 commandBufferObject := GetCommandBuffer(commandBuffer)
4174 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004175}
4176
4177@threadSafety("app")
4178cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004179 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004180 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004181 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004182 commandBufferObject := GetCommandBuffer(commandBuffer)
4183 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004184}
4185
4186@threadSafety("app")
4187cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004188 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004189 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004190 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004191 commandBufferObject := GetCommandBuffer(commandBuffer)
4192 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004193}
4194
4195@threadSafety("app")
4196cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004197 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004198 VkPipelineBindPoint pipelineBindPoint,
4199 VkPipelineLayout layout,
4200 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004201 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004202 const VkDescriptorSet* pDescriptorSets,
4203 u32 dynamicOffsetCount,
4204 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004205 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004206
Jesse Hall03b6fe12015-11-24 12:44:21 -08004207 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4208 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004209 descriptorSet := descriptorSets[i]
4210 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004211 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004212 }
4213
4214 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4215 for i in (0 .. dynamicOffsetCount) {
4216 dynamicOffset := dynamicOffsets[i]
4217 }
4218
Jesse Halld8bade02015-11-24 10:24:18 -08004219 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004220 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4221 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4222 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004223 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004224}
4225
4226@threadSafety("app")
4227cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004228 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004229 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004230 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004231 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004232 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004233 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004234 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004235
Jesse Hall3fbc8562015-11-29 22:10:52 -08004236 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004237
Jesse Hall3fbc8562015-11-29 22:10:52 -08004238 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004239}
4240
4241@threadSafety("app")
4242cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004243 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004244 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004245 u32 bindingCount,
4246 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004247 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004248 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004249
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004250 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004251 buffers := pBuffers[0:bindingCount]
4252 offsets := pOffsets[0:bindingCount]
4253 for i in (0 .. bindingCount) {
4254 buffer := buffers[i]
4255 offset := offsets[i]
4256 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004257 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004258
Jesse Hall3fbc8562015-11-29 22:10:52 -08004259 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004260 }
4261
Jesse Hall3fbc8562015-11-29 22:10:52 -08004262 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004263}
4264
4265@threadSafety("app")
4266cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004267 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004268 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004269 u32 instanceCount,
4270 u32 firstVertex,
4271 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004272 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004273
Jesse Hall3fbc8562015-11-29 22:10:52 -08004274 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004275}
4276
4277@threadSafety("app")
4278cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004279 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004280 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004281 u32 instanceCount,
4282 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004283 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004284 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004285 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004286
Jesse Hall3fbc8562015-11-29 22:10:52 -08004287 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004288}
4289
4290@threadSafety("app")
4291cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004292 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004293 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004294 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004295 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004296 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004297 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004298 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004299 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004300
Jesse Hall3fbc8562015-11-29 22:10:52 -08004301 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004302
Jesse Hall3fbc8562015-11-29 22:10:52 -08004303 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004304}
4305
4306@threadSafety("app")
4307cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004308 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004309 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004310 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004311 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004312 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004313 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004314 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004315 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004316
Jesse Hall3fbc8562015-11-29 22:10:52 -08004317 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004318
Jesse Hall3fbc8562015-11-29 22:10:52 -08004319 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004320}
4321
4322@threadSafety("app")
4323cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004324 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004325 u32 x,
4326 u32 y,
4327 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004328 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004329
Jesse Hall3fbc8562015-11-29 22:10:52 -08004330 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004331}
4332
4333@threadSafety("app")
4334cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004335 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004336 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004337 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004338 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004339 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004340 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004341
Jesse Hall3fbc8562015-11-29 22:10:52 -08004342 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004343
Jesse Hall3fbc8562015-11-29 22:10:52 -08004344 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004345}
4346
4347@threadSafety("app")
4348cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004349 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004350 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004351 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004352 u32 regionCount,
4353 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004354 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004355 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004356 dstBufferObject := GetBuffer(dstBuffer)
4357 assert(commandBufferObject.device == srcBufferObject.device)
4358 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004359
4360 regions := pRegions[0:regionCount]
4361 for i in (0 .. regionCount) {
4362 region := regions[i]
4363 }
4364
Jesse Hall3fbc8562015-11-29 22:10:52 -08004365 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4366 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004367
Jesse Hall65ab5522015-11-30 00:07:16 -08004368 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004369}
4370
4371@threadSafety("app")
4372cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004373 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004374 VkImage srcImage,
4375 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004376 VkImage dstImage,
4377 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004378 u32 regionCount,
4379 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004380 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004381 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004382 dstImageObject := GetImage(dstImage)
4383 assert(commandBufferObject.device == srcImageObject.device)
4384 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004385
4386 regions := pRegions[0:regionCount]
4387 for i in (0 .. regionCount) {
4388 region := regions[i]
4389 }
4390
Jesse Hall3fbc8562015-11-29 22:10:52 -08004391 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4392 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004393
Jesse Hall65ab5522015-11-30 00:07:16 -08004394 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004395}
4396
4397@threadSafety("app")
4398cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004399 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004400 VkImage srcImage,
4401 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004402 VkImage dstImage,
4403 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004404 u32 regionCount,
4405 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004406 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004407 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004408 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004409 dstImageObject := GetImage(dstImage)
4410 assert(commandBufferObject.device == srcImageObject.device)
4411 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004412
4413 regions := pRegions[0:regionCount]
4414 for i in (0 .. regionCount) {
4415 region := regions[i]
4416 }
4417
Jesse Hall3fbc8562015-11-29 22:10:52 -08004418 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4419 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004420
Jesse Hall3fbc8562015-11-29 22:10:52 -08004421 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004422}
4423
4424@threadSafety("app")
4425cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004426 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004427 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004428 VkImage dstImage,
4429 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004430 u32 regionCount,
4431 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004432 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004433 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004434 dstImageObject := GetImage(dstImage)
4435 assert(commandBufferObject.device == srcBufferObject.device)
4436 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004437
4438 regions := pRegions[0:regionCount]
4439 for i in (0 .. regionCount) {
4440 region := regions[i]
4441 }
4442
Jesse Hall3fbc8562015-11-29 22:10:52 -08004443 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4444 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004445
Jesse Hall65ab5522015-11-30 00:07:16 -08004446 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004447}
4448
4449@threadSafety("app")
4450cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004451 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004452 VkImage srcImage,
4453 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004454 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004455 u32 regionCount,
4456 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004457 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004458 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004459 dstBufferObject := GetBuffer(dstBuffer)
4460 assert(commandBufferObject.device == srcImageObject.device)
4461 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004462
4463 regions := pRegions[0:regionCount]
4464 for i in (0 .. regionCount) {
4465 region := regions[i]
4466 }
4467
Jesse Hall3fbc8562015-11-29 22:10:52 -08004468 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4469 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004470
Jesse Hall65ab5522015-11-30 00:07:16 -08004471 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004472}
4473
4474@threadSafety("app")
4475cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004476 VkCommandBuffer commandBuffer,
4477 VkBuffer dstBuffer,
4478 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004479 VkDeviceSize dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004480 const u32* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004481 commandBufferObject := GetCommandBuffer(commandBuffer)
4482 dstBufferObject := GetBuffer(dstBuffer)
4483 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004484
4485 data := pData[0:dataSize]
4486
Jesse Hall3fbc8562015-11-29 22:10:52 -08004487 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488
Jesse Hall65ab5522015-11-30 00:07:16 -08004489 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004490}
4491
4492@threadSafety("app")
4493cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004494 VkCommandBuffer commandBuffer,
4495 VkBuffer dstBuffer,
4496 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004497 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004498 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004499 commandBufferObject := GetCommandBuffer(commandBuffer)
4500 dstBufferObject := GetBuffer(dstBuffer)
4501 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004502
Jesse Hall65ab5522015-11-30 00:07:16 -08004503 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004504}
4505
4506@threadSafety("app")
4507cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004508 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004509 VkImage image,
4510 VkImageLayout imageLayout,
4511 const VkClearColorValue* pColor,
4512 u32 rangeCount,
4513 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004514 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004515 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004516 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004517
4518 ranges := pRanges[0:rangeCount]
4519 for i in (0 .. rangeCount) {
4520 range := ranges[i]
4521 }
4522
Jesse Hall3fbc8562015-11-29 22:10:52 -08004523 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004524
Jesse Hall3fbc8562015-11-29 22:10:52 -08004525 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004526}
4527
4528@threadSafety("app")
4529cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004530 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004531 VkImage image,
4532 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004533 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004534 u32 rangeCount,
4535 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004536 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004537 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004538 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004539
4540 ranges := pRanges[0:rangeCount]
4541 for i in (0 .. rangeCount) {
4542 range := ranges[i]
4543 }
4544
Jesse Hall3fbc8562015-11-29 22:10:52 -08004545 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004546
Jesse Hall3fbc8562015-11-29 22:10:52 -08004547 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004548}
4549
4550@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08004551cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004552 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08004553 u32 attachmentCount,
4554 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004555 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08004556 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004557 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004558
4559 rects := pRects[0:rectCount]
4560 for i in (0 .. rectCount) {
4561 rect := rects[i]
4562 }
4563
Jesse Hall3fbc8562015-11-29 22:10:52 -08004564 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004565}
4566
4567@threadSafety("app")
4568cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004569 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004570 VkImage srcImage,
4571 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004572 VkImage dstImage,
4573 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004574 u32 regionCount,
4575 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004576 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004577 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004578 dstImageObject := GetImage(dstImage)
4579 assert(commandBufferObject.device == srcImageObject.device)
4580 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004581
4582 regions := pRegions[0:regionCount]
4583 for i in (0 .. regionCount) {
4584 region := regions[i]
4585 }
4586
Jesse Hall3fbc8562015-11-29 22:10:52 -08004587 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4588 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004589
Jesse Hall3fbc8562015-11-29 22:10:52 -08004590 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004591}
4592
4593@threadSafety("app")
4594cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004595 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004596 VkEvent event,
4597 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004598 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004599 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004600 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004601}
4602
4603@threadSafety("app")
4604cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004605 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004606 VkEvent event,
4607 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004608 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004609 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004610 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004611}
4612
4613@threadSafety("app")
4614cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004615 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004616 u32 eventCount,
4617 const VkEvent* pEvents,
4618 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004619 VkPipelineStageFlags dstStageMask,
4620 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004621 const VkMemoryBarrier* pMemoryBarriers,
4622 u32 bufferMemoryBarrierCount,
4623 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4624 u32 imageMemoryBarrierCount,
4625 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004626 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004627
4628 events := pEvents[0:eventCount]
4629 for i in (0 .. eventCount) {
4630 event := events[i]
4631 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004632 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004633 }
4634
Jesse Hall3dd678a2016-01-08 21:52:01 -08004635 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004636 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004637 memoryBarrier := memoryBarriers[i]
4638 }
4639 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4640 for i in (0 .. bufferMemoryBarrierCount) {
4641 bufferMemoryBarrier := bufferMemoryBarriers[i]
4642 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4643 assert(bufferObject.device == commandBufferObject.device)
4644 }
4645 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4646 for i in (0 .. imageMemoryBarrierCount) {
4647 imageMemoryBarrier := imageMemoryBarriers[i]
4648 imageObject := GetImage(imageMemoryBarrier.image)
4649 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004650 }
4651}
4652
4653@threadSafety("app")
4654cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004655 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004656 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004657 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08004658 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004659 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004660 const VkMemoryBarrier* pMemoryBarriers,
4661 u32 bufferMemoryBarrierCount,
4662 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4663 u32 imageMemoryBarrierCount,
4664 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004665 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004666
Jesse Hall3dd678a2016-01-08 21:52:01 -08004667 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004668 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004669 memoryBarrier := memoryBarriers[i]
4670 }
4671 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4672 for i in (0 .. bufferMemoryBarrierCount) {
4673 bufferMemoryBarrier := bufferMemoryBarriers[i]
4674 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4675 assert(bufferObject.device == commandBufferObject.device)
4676 }
4677 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4678 for i in (0 .. imageMemoryBarrierCount) {
4679 imageMemoryBarrier := imageMemoryBarriers[i]
4680 imageObject := GetImage(imageMemoryBarrier.image)
4681 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004682 }
4683}
4684
4685@threadSafety("app")
4686cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004687 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004688 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004689 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004690 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004691 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004692 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004693 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004694}
4695
4696@threadSafety("app")
4697cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004698 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004699 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004700 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004701 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004702 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004703 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004704}
4705
4706@threadSafety("app")
4707cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004708 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004709 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004710 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004711 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004712 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004713 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004714 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004715}
4716
4717@threadSafety("app")
4718cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004719 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08004720 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004721 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004722 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004723 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004724 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004725 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004726}
4727
4728@threadSafety("app")
4729cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004730 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004731 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004732 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004733 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004734 VkBuffer dstBuffer,
4735 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004736 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004737 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004738 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004739 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004740 dstBufferObject := GetBuffer(dstBuffer)
4741 assert(commandBufferObject.device == queryPoolObject.device)
4742 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004743}
4744
4745cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004746 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004747 VkPipelineLayout layout,
4748 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004749 u32 offset,
4750 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004751 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004752 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004753 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004754 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004755}
4756
4757@threadSafety("app")
4758cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004759 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004760 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08004761 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004762 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004763 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
4764 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004765 assert(commandBufferObject.device == renderPassObject.device)
4766 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004767
Jesse Hall3fbc8562015-11-29 22:10:52 -08004768 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004769}
4770
4771cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004772 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08004773 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004774 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004775}
4776
4777@threadSafety("app")
4778cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004779 VkCommandBuffer commandBuffer) {
4780 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004781
Jesse Hall3fbc8562015-11-29 22:10:52 -08004782 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004783}
4784
4785cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004786 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004787 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004788 const VkCommandBuffer* pCommandBuffers) {
4789 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004790
Jesse Hall3dd678a2016-01-08 21:52:01 -08004791 commandBuffers := pCommandBuffers[0:commandBufferCount]
4792 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004793 secondaryCommandBuffer := commandBuffers[i]
4794 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
4795 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004796 }
4797}
4798
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004799@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004800cmd void vkDestroySurfaceKHR(
4801 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08004802 VkSurfaceKHR surface,
4803 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004804 instanceObject := GetInstance(instance)
4805 surfaceObject := GetSurface(surface)
4806 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08004807
Jesse Hall1356b0d2015-11-23 17:24:58 -08004808 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08004809}
4810
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004811@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004812cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004813 VkPhysicalDevice physicalDevice,
4814 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004815 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08004816 VkBool32* pSupported) {
4817 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004818
4819 return ?
4820}
4821
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004822@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004823cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
4824 VkPhysicalDevice physicalDevice,
4825 VkSurfaceKHR surface,
4826 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
4827 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4828
4829 surfaceCapabilities := ?
4830 pSurfaceCapabilities[0] = surfaceCapabilities
4831
4832 return ?
4833}
4834
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004835@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004836cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
4837 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004838 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004839 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004840 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004841 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004842
4843 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004844 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004845 surfaceFormats := pSurfaceFormats[0:count]
4846
4847 for i in (0 .. count) {
4848 surfaceFormat := ?
4849 surfaceFormats[i] = surfaceFormat
4850 }
4851
4852 return ?
4853}
4854
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004855@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004856cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
4857 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004858 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004859 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004860 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004861 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004862
4863 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004864 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004865 presentModes := pPresentModes[0:count]
4866
4867 for i in (0 .. count) {
4868 presentMode := ?
4869 presentModes[i] = presentMode
4870 }
4871
4872 return ?
4873}
4874
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004875@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004876cmd VkResult vkCreateSwapchainKHR(
4877 VkDevice device,
4878 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004879 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08004880 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004881 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08004882 deviceObject := GetDevice(device)
4883
4884 swapchain := ?
4885 pSwapchain[0] = swapchain
4886 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
4887
4888 return ?
4889}
4890
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004891@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004892cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08004893 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08004894 VkSwapchainKHR swapchain,
4895 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08004896 deviceObject := GetDevice(device)
4897 swapchainObject := GetSwapchain(swapchain)
4898 assert(swapchainObject.device == device)
4899
4900 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08004901}
4902
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004903@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004904cmd VkResult vkGetSwapchainImagesKHR(
4905 VkDevice device,
4906 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004907 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08004908 VkImage* pSwapchainImages) {
4909 deviceObject := GetDevice(device)
4910
4911 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004912 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004913 swapchainImages := pSwapchainImages[0:count]
4914
4915 for i in (0 .. count) {
4916 swapchainImage := ?
4917 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08004918 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08004919 }
4920
4921 return ?
4922}
4923
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004924@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004925cmd VkResult vkAcquireNextImageKHR(
4926 VkDevice device,
4927 VkSwapchainKHR swapchain,
4928 u64 timeout,
4929 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004930 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08004931 u32* pImageIndex) {
4932 deviceObject := GetDevice(device)
4933 swapchainObject := GetSwapchain(swapchain)
4934
4935 imageIndex := ?
4936 pImageIndex[0] = imageIndex
4937
4938 return ?
4939}
4940
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004941@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004942cmd VkResult vkQueuePresentKHR(
4943 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004944 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08004945 queueObject := GetQueue(queue)
4946
4947 presentInfo := ?
4948 pPresentInfo[0] = presentInfo
4949
4950 return ?
4951}
4952
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004953@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004954cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
4955 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004956 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004957 VkDisplayPropertiesKHR* pProperties) {
4958 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4959 return ?
4960}
4961
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004962@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004963cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
4964 VkPhysicalDevice physicalDevice,
4965 u32* pPropertyCount,
4966 VkDisplayPlanePropertiesKHR* pProperties) {
4967 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4968 return ?
4969}
4970
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004971@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004972cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
4973 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004974 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004975 u32* pDisplayCount,
4976 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08004977 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4978 return ?
4979}
4980
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004981@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004982cmd VkResult vkGetDisplayModePropertiesKHR(
4983 VkPhysicalDevice physicalDevice,
4984 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004985 u32* pPropertyCount,
4986 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004987 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4988 return ?
4989}
4990
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004991@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004992cmd VkResult vkCreateDisplayModeKHR(
4993 VkPhysicalDevice physicalDevice,
4994 VkDisplayKHR display,
4995 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004996 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004997 VkDisplayModeKHR* pMode) {
4998 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4999 return ?
5000}
5001
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005002@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005003cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005004 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005005 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005006 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005007 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005008 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5009 return ?
5010}
5011
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005012@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005013cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5014 VkInstance instance,
5015 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005016 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005017 VkSurfaceKHR* pSurface) {
5018 return ?
5019}
5020
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005021@extension("VK_KHR_display_swapchain")
5022cmd VkResult vkCreateSharedSwapchainsKHR(
5023 VkDevice device,
5024 u32 swapchainCount,
5025 const VkSwapchainCreateInfoKHR* pCreateInfos,
5026 const VkAllocationCallbacks* pAllocator,
5027 VkSwapchainKHR* pSwapchains) {
5028 return ?
5029}
5030
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005031@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005032cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005033 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005034 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005035 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005036 VkSurfaceKHR* pSurface) {
5037 instanceObject := GetInstance(instance)
5038 return ?
5039}
5040
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005041@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005042cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5043 VkPhysicalDevice physicalDevice,
5044 u32 queueFamilyIndex,
5045 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005046 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005047 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5048 return ?
5049}
5050
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005051@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005052cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005053 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005054 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005055 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005056 VkSurfaceKHR* pSurface) {
5057 instanceObject := GetInstance(instance)
5058 return ?
5059}
5060
Jesse Hall523db342015-11-30 21:12:55 -08005061@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005062cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5063 VkPhysicalDevice physicalDevice,
5064 u32 queueFamilyIndex,
5065 platform.xcb_connection_t* connection,
5066 platform.xcb_visualid_t visual_id) {
5067 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5068 return ?
5069}
5070
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005071@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005072cmd VkResult vkCreateWaylandSurfaceKHR(
5073 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005074 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005075 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005076 VkSurfaceKHR* pSurface) {
5077 instanceObject := GetInstance(instance)
5078 return ?
5079}
5080
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005081@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005082cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5083 VkPhysicalDevice physicalDevice,
5084 u32 queueFamilyIndex,
5085 platform.wl_display* display) {
5086 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5087 return ?
5088}
5089
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005090@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005091cmd VkResult vkCreateMirSurfaceKHR(
5092 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005093 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005094 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005095 VkSurfaceKHR* pSurface) {
5096 instanceObject := GetInstance(instance)
5097 return ?
5098}
5099
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005100@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005101cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5102 VkPhysicalDevice physicalDevice,
5103 u32 queueFamilyIndex,
5104 platform.MirConnection* connection) {
5105 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5106 return ?
5107}
5108
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005109@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005110cmd VkResult vkCreateAndroidSurfaceKHR(
5111 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005112 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005113 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005114 VkSurfaceKHR* pSurface) {
5115 instanceObject := GetInstance(instance)
5116 return ?
5117}
5118
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005119@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005120cmd VkResult vkCreateWin32SurfaceKHR(
5121 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005122 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005123 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005124 VkSurfaceKHR* pSurface) {
5125 instanceObject := GetInstance(instance)
5126 return ?
5127}
5128
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005129@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005130cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5131 VkPhysicalDevice physicalDevice,
5132 u32 queueFamilyIndex) {
5133 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5134 return ?
5135}
5136
Jesse Hall715b86a2016-01-16 16:34:29 -08005137@extension("VK_EXT_debug_report")
5138@external type void* PFN_vkDebugReportCallbackEXT
5139@extension("VK_EXT_debug_report")
5140@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5141 VkDebugReportFlagsEXT flags,
5142 VkDebugReportObjectTypeEXT objectType,
5143 u64 object,
5144 platform.size_t location,
5145 s32 messageCode,
5146 const char* pLayerPrefix,
5147 const char* pMessage,
5148 void* pUserData) {
5149 return ?
5150}
5151
5152@extension("VK_EXT_debug_report")
5153cmd VkResult vkCreateDebugReportCallbackEXT(
5154 VkInstance instance,
5155 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5156 const VkAllocationCallbacks* pAllocator,
5157 VkDebugReportCallbackEXT* pCallback) {
5158 return ?
5159}
5160
5161@extension("VK_EXT_debug_report")
5162cmd void vkDestroyDebugReportCallbackEXT(
5163 VkInstance instance,
5164 VkDebugReportCallbackEXT callback,
5165 const VkAllocationCallbacks* pAllocator) {
5166}
5167
5168@extension("VK_EXT_debug_report")
5169cmd void vkDebugReportMessageEXT(
5170 VkInstance instance,
5171 VkDebugReportFlagsEXT flags,
5172 VkDebugReportObjectTypeEXT objectType,
5173 u64 object,
5174 platform.size_t location,
5175 s32 messageCode,
5176 const char* pLayerPrefix,
5177 const char* pMessage) {
5178}
5179
Jesse Halld27f6aa2015-08-15 17:58:48 -07005180
5181////////////////
5182// Validation //
5183////////////////
5184
5185extern void validate(string layerName, bool condition, string message)
5186
5187
5188/////////////////////////////
5189// Internal State Tracking //
5190/////////////////////////////
5191
5192StateObject State
5193
5194@internal class StateObject {
5195 // Dispatchable objects.
5196 map!(VkInstance, ref!InstanceObject) Instances
5197 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5198 map!(VkDevice, ref!DeviceObject) Devices
5199 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005200 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005201
5202 // Non-dispatchable objects.
5203 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5204 map!(VkBuffer, ref!BufferObject) Buffers
5205 map!(VkBufferView, ref!BufferViewObject) BufferViews
5206 map!(VkImage, ref!ImageObject) Images
5207 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005208 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005209 map!(VkPipeline, ref!PipelineObject) Pipelines
5210 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5211 map!(VkSampler, ref!SamplerObject) Samplers
5212 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5213 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5214 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005215 map!(VkFence, ref!FenceObject) Fences
5216 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5217 map!(VkEvent, ref!EventObject) Events
5218 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5219 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5220 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5221 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005222 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005223 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005224 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005225}
5226
5227@internal class InstanceObject {
5228}
5229
5230@internal class PhysicalDeviceObject {
5231 VkInstance instance
5232}
5233
5234@internal class DeviceObject {
5235 VkPhysicalDevice physicalDevice
5236}
5237
5238@internal class QueueObject {
5239 VkDevice device
5240 VkQueueFlags flags
5241}
5242
Jesse Hall3fbc8562015-11-29 22:10:52 -08005243@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005244 VkDevice device
5245 map!(u64, VkDeviceMemory) boundObjects
5246 VkQueueFlags queueFlags
5247}
5248
5249@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005250 VkDevice device
5251 VkDeviceSize allocationSize
5252 map!(u64, VkDeviceSize) boundObjects
5253 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005254}
5255
5256@internal class BufferObject {
5257 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005258 VkDeviceMemory memory
5259 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005260}
5261
5262@internal class BufferViewObject {
5263 VkDevice device
5264 VkBuffer buffer
5265}
5266
5267@internal class ImageObject {
5268 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005269 VkDeviceMemory memory
5270 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005271}
5272
5273@internal class ImageViewObject {
5274 VkDevice device
5275 VkImage image
5276}
5277
Jesse Halld27f6aa2015-08-15 17:58:48 -07005278@internal class ShaderObject {
5279 VkDevice device
5280}
5281
5282@internal class ShaderModuleObject {
5283 VkDevice device
5284}
5285
5286@internal class PipelineObject {
5287 VkDevice device
5288}
5289
5290@internal class PipelineLayoutObject {
5291 VkDevice device
5292}
5293
5294@internal class SamplerObject {
5295 VkDevice device
5296}
5297
5298@internal class DescriptorSetObject {
5299 VkDevice device
5300}
5301
5302@internal class DescriptorSetLayoutObject {
5303 VkDevice device
5304}
5305
5306@internal class DescriptorPoolObject {
5307 VkDevice device
5308}
5309
Jesse Halld27f6aa2015-08-15 17:58:48 -07005310@internal class FenceObject {
5311 VkDevice device
5312 bool signaled
5313}
5314
5315@internal class SemaphoreObject {
5316 VkDevice device
5317}
5318
5319@internal class EventObject {
5320 VkDevice device
5321}
5322
5323@internal class QueryPoolObject {
5324 VkDevice device
5325}
5326
5327@internal class FramebufferObject {
5328 VkDevice device
5329}
5330
5331@internal class RenderPassObject {
5332 VkDevice device
5333}
5334
5335@internal class PipelineCacheObject {
5336 VkDevice device
5337}
5338
Jesse Hall3fbc8562015-11-29 22:10:52 -08005339@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005340 VkDevice device
5341}
5342
Jesse Hall1356b0d2015-11-23 17:24:58 -08005343@internal class SurfaceObject {
5344 VkInstance instance
5345}
5346
Michael Lentine88594d72015-11-12 12:49:45 -08005347@internal class SwapchainObject {
5348 VkDevice device
5349}
5350
Jesse Halld27f6aa2015-08-15 17:58:48 -07005351macro ref!InstanceObject GetInstance(VkInstance instance) {
5352 assert(instance in State.Instances)
5353 return State.Instances[instance]
5354}
5355
5356macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
5357 assert(physicalDevice in State.PhysicalDevices)
5358 return State.PhysicalDevices[physicalDevice]
5359}
5360
5361macro ref!DeviceObject GetDevice(VkDevice device) {
5362 assert(device in State.Devices)
5363 return State.Devices[device]
5364}
5365
5366macro ref!QueueObject GetQueue(VkQueue queue) {
5367 assert(queue in State.Queues)
5368 return State.Queues[queue]
5369}
5370
Jesse Hall3fbc8562015-11-29 22:10:52 -08005371macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
5372 assert(commandBuffer in State.CommandBuffers)
5373 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005374}
5375
Jesse Hall3fbc8562015-11-29 22:10:52 -08005376macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
5377 assert(memory in State.DeviceMemories)
5378 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005379}
5380
5381macro ref!BufferObject GetBuffer(VkBuffer buffer) {
5382 assert(buffer in State.Buffers)
5383 return State.Buffers[buffer]
5384}
5385
5386macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
5387 assert(bufferView in State.BufferViews)
5388 return State.BufferViews[bufferView]
5389}
5390
5391macro ref!ImageObject GetImage(VkImage image) {
5392 assert(image in State.Images)
5393 return State.Images[image]
5394}
5395
5396macro ref!ImageViewObject GetImageView(VkImageView imageView) {
5397 assert(imageView in State.ImageViews)
5398 return State.ImageViews[imageView]
5399}
5400
Jesse Halld27f6aa2015-08-15 17:58:48 -07005401macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
5402 assert(shaderModule in State.ShaderModules)
5403 return State.ShaderModules[shaderModule]
5404}
5405
5406macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
5407 assert(pipeline in State.Pipelines)
5408 return State.Pipelines[pipeline]
5409}
5410
5411macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
5412 assert(pipelineLayout in State.PipelineLayouts)
5413 return State.PipelineLayouts[pipelineLayout]
5414}
5415
5416macro ref!SamplerObject GetSampler(VkSampler sampler) {
5417 assert(sampler in State.Samplers)
5418 return State.Samplers[sampler]
5419}
5420
5421macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
5422 assert(descriptorSet in State.DescriptorSets)
5423 return State.DescriptorSets[descriptorSet]
5424}
5425
5426macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
5427 assert(descriptorSetLayout in State.DescriptorSetLayouts)
5428 return State.DescriptorSetLayouts[descriptorSetLayout]
5429}
5430
5431macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
5432 assert(descriptorPool in State.DescriptorPools)
5433 return State.DescriptorPools[descriptorPool]
5434}
5435
Jesse Halld27f6aa2015-08-15 17:58:48 -07005436macro ref!FenceObject GetFence(VkFence fence) {
5437 assert(fence in State.Fences)
5438 return State.Fences[fence]
5439}
5440
5441macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
5442 assert(semaphore in State.Semaphores)
5443 return State.Semaphores[semaphore]
5444}
5445
5446macro ref!EventObject GetEvent(VkEvent event) {
5447 assert(event in State.Events)
5448 return State.Events[event]
5449}
5450
5451macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
5452 assert(queryPool in State.QueryPools)
5453 return State.QueryPools[queryPool]
5454}
5455
5456macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
5457 assert(framebuffer in State.Framebuffers)
5458 return State.Framebuffers[framebuffer]
5459}
5460
5461macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
5462 assert(renderPass in State.RenderPasses)
5463 return State.RenderPasses[renderPass]
5464}
5465
5466macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
5467 assert(pipelineCache in State.PipelineCaches)
5468 return State.PipelineCaches[pipelineCache]
5469}
5470
Jesse Hall3fbc8562015-11-29 22:10:52 -08005471macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
5472 assert(commandPool in State.CommandPools)
5473 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07005474}
Michael Lentine88594d72015-11-12 12:49:45 -08005475
Jesse Hall1356b0d2015-11-23 17:24:58 -08005476macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
5477 assert(surface in State.Surfaces)
5478 return State.Surfaces[surface]
5479}
5480
Michael Lentine88594d72015-11-12 12:49:45 -08005481macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
5482 assert(swapchain in State.Swapchains)
5483 return State.Swapchains[swapchain]
5484}
Jesse Halld8bade02015-11-24 10:24:18 -08005485
5486macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
5487 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
5488}