blob: b74062f00c9b83e8840d30f2b38493705d58ccef [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 Hallf9fa9a52016-01-08 16:08:51 -080031define VERSION_PATCH 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall543a7ff2016-01-08 16:38:30 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 24
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall543a7ff2016-01-08 16:38:30 -080051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 67
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall543a7ff2016-01-08 16:38:30 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Jesse Halld27f6aa2015-08-15 17:58:48 -070078
79/////////////
80// Types //
81/////////////
82
Jesse Hall5ae3abb2015-10-08 14:00:22 -070083type u32 VkBool32
84type u32 VkFlags
85type u64 VkDeviceSize
86type u32 VkSampleMask
87
Jesse Halld27f6aa2015-08-15 17:58:48 -070088/// Dispatchable handle types.
89@dispatchHandle type u64 VkInstance
90@dispatchHandle type u64 VkPhysicalDevice
91@dispatchHandle type u64 VkDevice
92@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -080093@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -070094
95/// Non dispatchable handle types.
96@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -080097@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -070098@nonDispatchHandle type u64 VkBuffer
99@nonDispatchHandle type u64 VkBufferView
100@nonDispatchHandle type u64 VkImage
101@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700102@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700103@nonDispatchHandle type u64 VkPipeline
104@nonDispatchHandle type u64 VkPipelineLayout
105@nonDispatchHandle type u64 VkSampler
106@nonDispatchHandle type u64 VkDescriptorSet
107@nonDispatchHandle type u64 VkDescriptorSetLayout
108@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700109@nonDispatchHandle type u64 VkFence
110@nonDispatchHandle type u64 VkSemaphore
111@nonDispatchHandle type u64 VkEvent
112@nonDispatchHandle type u64 VkQueryPool
113@nonDispatchHandle type u64 VkFramebuffer
114@nonDispatchHandle type u64 VkRenderPass
115@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800116
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800117@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800118
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800119@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800120
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800121@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
122@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700123
124
125/////////////
126// Enums //
127/////////////
128
129enum VkImageLayout {
130 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
131 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
132 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
133 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
134 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
135 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 -0800136 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
137 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 -0700138 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800139
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800140 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800141 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700142}
143
144enum VkAttachmentLoadOp {
145 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
146 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
147 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
148}
149
150enum VkAttachmentStoreOp {
151 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
152 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
153}
154
155enum VkImageType {
156 VK_IMAGE_TYPE_1D = 0x00000000,
157 VK_IMAGE_TYPE_2D = 0x00000001,
158 VK_IMAGE_TYPE_3D = 0x00000002,
159}
160
161enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800162 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
163 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700164}
165
166enum VkImageViewType {
167 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
168 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
169 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
170 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
171 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
172 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
173 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
174}
175
Jesse Hall3fbc8562015-11-29 22:10:52 -0800176enum VkCommandBufferLevel {
177 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
178 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700179}
180
Jesse Hall65ab5522015-11-30 00:07:16 -0800181enum VkComponentSwizzle {
182 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
183 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
184 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
185 VK_COMPONENT_SWIZZLE_R = 0x00000003,
186 VK_COMPONENT_SWIZZLE_G = 0x00000004,
187 VK_COMPONENT_SWIZZLE_B = 0x00000005,
188 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700189}
190
191enum VkDescriptorType {
192 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
193 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
194 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
195 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
196 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
197 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
198 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
199 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
200 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
201 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
202 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
203}
204
Jesse Halld27f6aa2015-08-15 17:58:48 -0700205enum VkQueryType {
206 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
207 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800208 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700209}
210
Jesse Halld27f6aa2015-08-15 17:58:48 -0700211enum VkBorderColor {
212 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
213 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
214 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
215 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
216 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
217 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
218}
219
220enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800221 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
222 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700223}
224
225enum VkPrimitiveTopology {
226 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
227 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
228 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
229 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
230 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
231 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800232 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
233 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
234 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
235 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800236 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700237}
238
239enum VkSharingMode {
240 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
241 VK_SHARING_MODE_CONCURRENT = 0x00000001,
242}
243
244enum VkIndexType {
245 VK_INDEX_TYPE_UINT16 = 0x00000000,
246 VK_INDEX_TYPE_UINT32 = 0x00000001,
247}
248
Jesse Hall23ff73f2015-11-29 14:36:39 -0800249enum VkFilter {
250 VK_FILTER_NEAREST = 0x00000000,
251 VK_FILTER_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700252}
253
Jesse Hall23ff73f2015-11-29 14:36:39 -0800254enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800255 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
256 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700257}
258
Jesse Hall23ff73f2015-11-29 14:36:39 -0800259enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800260 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
261 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
262 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
263 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
264 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700265}
266
267enum VkCompareOp {
268 VK_COMPARE_OP_NEVER = 0x00000000,
269 VK_COMPARE_OP_LESS = 0x00000001,
270 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800271 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700272 VK_COMPARE_OP_GREATER = 0x00000004,
273 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800274 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700275 VK_COMPARE_OP_ALWAYS = 0x00000007,
276}
277
Jesse Hall65ab5522015-11-30 00:07:16 -0800278enum VkPolygonMode {
279 VK_POLYGON_MODE_FILL = 0x00000000,
280 VK_POLYGON_MODE_LINE = 0x00000001,
281 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700282}
283
284enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800285 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
286 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700287}
288
Jesse Hall65ab5522015-11-30 00:07:16 -0800289enum VkBlendFactor {
290 VK_BLEND_FACTOR_ZERO = 0x00000000,
291 VK_BLEND_FACTOR_ONE = 0x00000001,
292 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
293 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
294 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
295 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
296 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
297 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
298 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
299 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
300 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
301 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
302 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
303 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
304 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
305 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
306 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
307 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
308 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700309}
310
311enum VkBlendOp {
312 VK_BLEND_OP_ADD = 0x00000000,
313 VK_BLEND_OP_SUBTRACT = 0x00000001,
314 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
315 VK_BLEND_OP_MIN = 0x00000003,
316 VK_BLEND_OP_MAX = 0x00000004,
317}
318
319enum VkStencilOp {
320 VK_STENCIL_OP_KEEP = 0x00000000,
321 VK_STENCIL_OP_ZERO = 0x00000001,
322 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800323 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
324 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700325 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800326 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
327 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700328}
329
330enum VkLogicOp {
331 VK_LOGIC_OP_CLEAR = 0x00000000,
332 VK_LOGIC_OP_AND = 0x00000001,
333 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
334 VK_LOGIC_OP_COPY = 0x00000003,
335 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800336 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700337 VK_LOGIC_OP_XOR = 0x00000006,
338 VK_LOGIC_OP_OR = 0x00000007,
339 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800340 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700341 VK_LOGIC_OP_INVERT = 0x0000000a,
342 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
343 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
344 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
345 VK_LOGIC_OP_NAND = 0x0000000e,
346 VK_LOGIC_OP_SET = 0x0000000f,
347}
348
Jesse Hall3fbc8562015-11-29 22:10:52 -0800349enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800350 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800351 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
352 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
353 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
354 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800355}
356
Jesse Hall3fbc8562015-11-29 22:10:52 -0800357enum VkInternalAllocationType {
358 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700359}
360
361enum VkPhysicalDeviceType {
362 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
363 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
364 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
365 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
366 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
367}
368
Jesse Hall65ab5522015-11-30 00:07:16 -0800369enum VkVertexInputRate {
370 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
371 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700372}
373
374/// Vulkan format definitions
375enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800376 VK_FORMAT_UNDEFINED = 0,
377 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
378 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
379 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
380 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
381 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
382 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
383 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
384 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
385 VK_FORMAT_R8_UNORM = 9,
386 VK_FORMAT_R8_SNORM = 10,
387 VK_FORMAT_R8_USCALED = 11,
388 VK_FORMAT_R8_SSCALED = 12,
389 VK_FORMAT_R8_UINT = 13,
390 VK_FORMAT_R8_SINT = 14,
391 VK_FORMAT_R8_SRGB = 15,
392 VK_FORMAT_R8G8_UNORM = 16,
393 VK_FORMAT_R8G8_SNORM = 17,
394 VK_FORMAT_R8G8_USCALED = 18,
395 VK_FORMAT_R8G8_SSCALED = 19,
396 VK_FORMAT_R8G8_UINT = 20,
397 VK_FORMAT_R8G8_SINT = 21,
398 VK_FORMAT_R8G8_SRGB = 22,
399 VK_FORMAT_R8G8B8_UNORM = 23,
400 VK_FORMAT_R8G8B8_SNORM = 24,
401 VK_FORMAT_R8G8B8_USCALED = 25,
402 VK_FORMAT_R8G8B8_SSCALED = 26,
403 VK_FORMAT_R8G8B8_UINT = 27,
404 VK_FORMAT_R8G8B8_SINT = 28,
405 VK_FORMAT_R8G8B8_SRGB = 29,
406 VK_FORMAT_B8G8R8_UNORM = 30,
407 VK_FORMAT_B8G8R8_SNORM = 31,
408 VK_FORMAT_B8G8R8_USCALED = 32,
409 VK_FORMAT_B8G8R8_SSCALED = 33,
410 VK_FORMAT_B8G8R8_UINT = 34,
411 VK_FORMAT_B8G8R8_SINT = 35,
412 VK_FORMAT_B8G8R8_SRGB = 36,
413 VK_FORMAT_R8G8B8A8_UNORM = 37,
414 VK_FORMAT_R8G8B8A8_SNORM = 38,
415 VK_FORMAT_R8G8B8A8_USCALED = 39,
416 VK_FORMAT_R8G8B8A8_SSCALED = 40,
417 VK_FORMAT_R8G8B8A8_UINT = 41,
418 VK_FORMAT_R8G8B8A8_SINT = 42,
419 VK_FORMAT_R8G8B8A8_SRGB = 43,
420 VK_FORMAT_B8G8R8A8_UNORM = 44,
421 VK_FORMAT_B8G8R8A8_SNORM = 45,
422 VK_FORMAT_B8G8R8A8_USCALED = 46,
423 VK_FORMAT_B8G8R8A8_SSCALED = 47,
424 VK_FORMAT_B8G8R8A8_UINT = 48,
425 VK_FORMAT_B8G8R8A8_SINT = 49,
426 VK_FORMAT_B8G8R8A8_SRGB = 50,
427 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
428 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
429 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
430 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
431 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
432 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
433 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
434 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
435 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
436 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
437 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
438 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
439 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
440 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
441 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
442 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
443 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
444 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
445 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
446 VK_FORMAT_R16_UNORM = 70,
447 VK_FORMAT_R16_SNORM = 71,
448 VK_FORMAT_R16_USCALED = 72,
449 VK_FORMAT_R16_SSCALED = 73,
450 VK_FORMAT_R16_UINT = 74,
451 VK_FORMAT_R16_SINT = 75,
452 VK_FORMAT_R16_SFLOAT = 76,
453 VK_FORMAT_R16G16_UNORM = 77,
454 VK_FORMAT_R16G16_SNORM = 78,
455 VK_FORMAT_R16G16_USCALED = 79,
456 VK_FORMAT_R16G16_SSCALED = 80,
457 VK_FORMAT_R16G16_UINT = 81,
458 VK_FORMAT_R16G16_SINT = 82,
459 VK_FORMAT_R16G16_SFLOAT = 83,
460 VK_FORMAT_R16G16B16_UNORM = 84,
461 VK_FORMAT_R16G16B16_SNORM = 85,
462 VK_FORMAT_R16G16B16_USCALED = 86,
463 VK_FORMAT_R16G16B16_SSCALED = 87,
464 VK_FORMAT_R16G16B16_UINT = 88,
465 VK_FORMAT_R16G16B16_SINT = 89,
466 VK_FORMAT_R16G16B16_SFLOAT = 90,
467 VK_FORMAT_R16G16B16A16_UNORM = 91,
468 VK_FORMAT_R16G16B16A16_SNORM = 92,
469 VK_FORMAT_R16G16B16A16_USCALED = 93,
470 VK_FORMAT_R16G16B16A16_SSCALED = 94,
471 VK_FORMAT_R16G16B16A16_UINT = 95,
472 VK_FORMAT_R16G16B16A16_SINT = 96,
473 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
474 VK_FORMAT_R32_UINT = 98,
475 VK_FORMAT_R32_SINT = 99,
476 VK_FORMAT_R32_SFLOAT = 100,
477 VK_FORMAT_R32G32_UINT = 101,
478 VK_FORMAT_R32G32_SINT = 102,
479 VK_FORMAT_R32G32_SFLOAT = 103,
480 VK_FORMAT_R32G32B32_UINT = 104,
481 VK_FORMAT_R32G32B32_SINT = 105,
482 VK_FORMAT_R32G32B32_SFLOAT = 106,
483 VK_FORMAT_R32G32B32A32_UINT = 107,
484 VK_FORMAT_R32G32B32A32_SINT = 108,
485 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
486 VK_FORMAT_R64_UINT = 110,
487 VK_FORMAT_R64_SINT = 111,
488 VK_FORMAT_R64_SFLOAT = 112,
489 VK_FORMAT_R64G64_UINT = 113,
490 VK_FORMAT_R64G64_SINT = 114,
491 VK_FORMAT_R64G64_SFLOAT = 115,
492 VK_FORMAT_R64G64B64_UINT = 116,
493 VK_FORMAT_R64G64B64_SINT = 117,
494 VK_FORMAT_R64G64B64_SFLOAT = 118,
495 VK_FORMAT_R64G64B64A64_UINT = 119,
496 VK_FORMAT_R64G64B64A64_SINT = 120,
497 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
498 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
499 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
500 VK_FORMAT_D16_UNORM = 124,
501 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
502 VK_FORMAT_D32_SFLOAT = 126,
503 VK_FORMAT_S8_UINT = 127,
504 VK_FORMAT_D16_UNORM_S8_UINT = 128,
505 VK_FORMAT_D24_UNORM_S8_UINT = 129,
506 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
507 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
508 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
509 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
510 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
511 VK_FORMAT_BC2_UNORM_BLOCK = 135,
512 VK_FORMAT_BC2_SRGB_BLOCK = 136,
513 VK_FORMAT_BC3_UNORM_BLOCK = 137,
514 VK_FORMAT_BC3_SRGB_BLOCK = 138,
515 VK_FORMAT_BC4_UNORM_BLOCK = 139,
516 VK_FORMAT_BC4_SNORM_BLOCK = 140,
517 VK_FORMAT_BC5_UNORM_BLOCK = 141,
518 VK_FORMAT_BC5_SNORM_BLOCK = 142,
519 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
520 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
521 VK_FORMAT_BC7_UNORM_BLOCK = 145,
522 VK_FORMAT_BC7_SRGB_BLOCK = 146,
523 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
524 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
525 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
526 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
527 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
528 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
529 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
530 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
531 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
532 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
533 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
534 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
535 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
536 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
537 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
538 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
539 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
540 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
541 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
542 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
543 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
544 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
545 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
546 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
547 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
548 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
549 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
550 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
551 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
552 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
553 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
554 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
555 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
556 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
557 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
558 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
559 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
560 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700561}
562
Jesse Halld27f6aa2015-08-15 17:58:48 -0700563/// Structure type enumerant
564enum VkStructureType {
565 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800566 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
567 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
568 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
569 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800570 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800571 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
572 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
573 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
574 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700575 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800576 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
577 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
578 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
579 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
580 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
581 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800582 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
583 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
584 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
585 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
586 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
587 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
588 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
589 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
590 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
591 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
592 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
593 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
594 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
595 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
596 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
597 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
598 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800599 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800600 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
601 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
602 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
603 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
604 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800605 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800606 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
607 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
608 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
609 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
610 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
611 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
612 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
613 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800614
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800615 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800616 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
617 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800618
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800619 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800620 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
621 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800622
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800623 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800624 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800625
626 //@extension("VK_KHR_xlib_surface")
627 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
628
629 //@extension("VK_KHR_xcb_surface")
630 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
631
632 //@extension("VK_KHR_wayland_surface")
633 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
634
635 //@extension("VK_KHR_mir_surface")
636 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
637
638 //@extension("VK_KHR_android_surface")
639 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
640
641 //@extension("VK_KHR_win32_surface")
642 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800643
644 //@extension("VK_EXT_debug_report")
645 VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = 1000011000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700646}
647
Jesse Hall65ab5522015-11-30 00:07:16 -0800648enum VkSubpassContents {
649 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
650 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700651}
652
Jesse Hall543a7ff2016-01-08 16:38:30 -0800653enum VkPipelineCacheHeaderVersion {
654 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
655}
656
Jesse Hallbd888842015-11-30 21:44:14 -0800657@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700658/// Error and return codes
659enum VkResult {
660 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800661 VK_SUCCESS = 0,
662 VK_NOT_READY = 1,
663 VK_TIMEOUT = 2,
664 VK_EVENT_SET = 3,
665 VK_EVENT_RESET = 4,
666 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700667
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800668 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800669 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800670
Jesse Halld27f6aa2015-08-15 17:58:48 -0700671 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800672 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
673 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
674 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
675 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
676 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
677 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
678 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
679 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
680 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
681 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
682 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall1356b0d2015-11-23 17:24:58 -0800683
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800684 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800685 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800686
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800687 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800688 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800689
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800690 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800691 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800692
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800693 //@extension("VK_KHR_android_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800694 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46516C0, // -1000008000
Jesse Hall543a7ff2016-01-08 16:38:30 -0800695
696 //@extension("VK_EXT_debug_report")
697 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700698}
699
700enum VkDynamicState {
701 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
702 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
703 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
704 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
705 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
706 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
707 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
708 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
709 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700710}
711
Jesse Hall523db342015-11-30 21:12:55 -0800712@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800713enum VkPresentModeKHR {
714 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
715 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
716 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800717 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800718}
719
Jesse Hall523db342015-11-30 21:12:55 -0800720@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800721enum VkColorSpaceKHR {
722 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
723}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700724
725/////////////////
726// Bitfields //
727/////////////////
728
Jesse Halld27f6aa2015-08-15 17:58:48 -0700729/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -0800730type VkFlags VkQueueFlags
731bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700732 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
733 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -0800734 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -0800735 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700736}
737
738/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -0800739type VkFlags VkMemoryPropertyFlags
740bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800741 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
742 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
743 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
744 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
745 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700746}
747
748/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -0800749type VkFlags VkMemoryHeapFlags
750bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800751 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700752}
753
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800754/// Access flags
755type VkFlags VkAccessFlags
756bitfield VkAccessFlagBits {
757 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
758 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
759 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
760 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
761 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
762 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
763 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
764 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
765 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
766 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
767 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
768 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
769 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
770 VK_ACCESS_HOST_READ_BIT = 0x00002000,
771 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
772 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
773 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700774}
775
776/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800777type VkFlags VkBufferUsageFlags
778bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800779 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
780 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700781 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
782 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
783 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
784 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
785 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
786 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
787 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
788}
789
790/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800791type VkFlags VkBufferCreateFlags
792bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700793 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700794 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
795 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
796}
797
798/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800799type VkFlags VkShaderStageFlags
800bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700801 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -0800802 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
803 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700804 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
805 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
806 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -0800807 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700808
809 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
810}
811
Jesse Hallfbf97b02015-11-20 14:17:03 -0800812/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -0800813type VkFlags VkDescriptorPoolCreateFlags
814bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800815 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
816}
817
818/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -0800819type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -0800820//bitfield VkDescriptorPoolResetFlagBits {
821//}
Jesse Hallfbf97b02015-11-20 14:17:03 -0800822
Jesse Halld27f6aa2015-08-15 17:58:48 -0700823/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800824type VkFlags VkImageUsageFlags
825bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800826 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
827 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700828 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
829 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
830 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700831 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -0700832 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
833 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
834}
835
836/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800837type VkFlags VkImageCreateFlags
838bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700839 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700840 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
841 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 -0700842 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
843 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 -0700844}
845
Jesse Hallb00daad2015-11-29 19:46:20 -0800846/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800847type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -0800848//bitfield VkImageViewCreateFlagBits {
849//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700850
851/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800852type VkFlags VkPipelineCreateFlags
853bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700854 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
855 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
856 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
857}
858
Jesse Hall65ab5522015-11-30 00:07:16 -0800859/// Color component flags
860type VkFlags VkColorComponentFlags
861bitfield VkColorComponentFlagBits {
862 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
863 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
864 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
865 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700866}
867
868/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800869type VkFlags VkFenceCreateFlags
870bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700871 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
872}
873
874/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800875type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800876//bitfield VkSemaphoreCreateFlagBits {
877//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700878
879/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -0800880type VkFlags VkFormatFeatureFlags
881bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700882 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
883 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
884 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
885 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
886 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
887 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
888 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
889 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
890 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
891 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -0800892 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
893 VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCommandBlitImage
Jesse Halld27f6aa2015-08-15 17:58:48 -0700894}
895
896/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -0800897type VkFlags VkQueryControlFlags
898bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -0800899 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700900}
901
902/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -0800903type VkFlags VkQueryResultFlags
904bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700905 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
906 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
907 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
908 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
909}
910
911/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800912type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800913//bitfield VkShaderModuleCreateFlagBits {
914//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700915
Jesse Halld27f6aa2015-08-15 17:58:48 -0700916/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800917type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800918//bitfield VkEventCreateFlagBits {
919//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700920
Jesse Halla15a4bf2015-11-19 22:48:02 -0800921/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -0800922type VkFlags VkCommandBufferUsageFlags
923bitfield VkCommandBufferUsageFlagBits {
924 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
925 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
926 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700927}
928
929/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -0800930type VkFlags VkQueryPipelineStatisticFlags
931bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -0800932 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
933 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
934 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
935 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
936 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
937 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
938 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
939 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
940 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
941 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
942 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -0700943}
944
945/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -0800946type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -0800947//bitfield VkMemoryMapFlagBits {
948//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700949
950/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -0800951type VkFlags VkImageAspectFlags
952bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700953 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
954 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
955 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
956 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
957}
958
959/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -0800960type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -0800961bitfield VkSparseMemoryBindFlagBits {
962 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
963}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700964
965/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -0800966type VkFlags VkSparseImageFormatFlags
967bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -0800968 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
969 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.
970 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -0700971}
972
973/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -0800974type VkFlags VkPipelineStageFlags
975bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700976 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
977 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
978 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
979 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -0800980 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
981 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -0700982 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
983 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
984 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
985 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
986 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
987 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
988 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -0800989 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
990 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -0700991
Jesse Hall543a7ff2016-01-08 16:38:30 -0800992 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
993 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700994}
995
996/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -0800997type VkFlags VkAttachmentDescriptionFlags
998bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700999 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 -07001000}
1001
1002/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001003type VkFlags VkSubpassDescriptionFlags
1004bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001005}
1006
1007/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001008type VkFlags VkCommandPoolCreateFlags
1009bitfield VkCommandPoolCreateFlagBits {
1010 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1011 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001012}
1013
1014/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001015type VkFlags VkCommandPoolResetFlags
1016bitfield VkCommandPoolResetFlagBits {
1017 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001018}
1019
Jesse Hall3fbc8562015-11-29 22:10:52 -08001020type VkFlags VkCommandBufferResetFlags
1021bitfield VkCommandBufferResetFlagBits {
1022 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001023}
1024
Jesse Halld8bade02015-11-24 10:24:18 -08001025type VkFlags VkSampleCountFlags
1026bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001027 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1028 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1029 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1030 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1031 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1032 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1033 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1034}
1035
Jesse Halld8bade02015-11-24 10:24:18 -08001036type VkFlags VkStencilFaceFlags
1037bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001038 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1039 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001040 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001041}
1042
Jesse Halla6429252015-11-29 18:59:42 -08001043/// Instance creation flags
1044type VkFlags VkInstanceCreateFlags
1045//bitfield VkInstanceCreateFlagBits {
1046//}
1047
1048/// Device creation flags
1049type VkFlags VkDeviceCreateFlags
1050//bitfield VkDeviceCreateFlagBits {
1051//}
1052
1053/// Device queue creation flags
1054type VkFlags VkDeviceQueueCreateFlags
1055//bitfield VkDeviceQueueCreateFlagBits {
1056//}
1057
1058/// Query pool creation flags
1059type VkFlags VkQueryPoolCreateFlags
1060//bitfield VkQueryPoolCreateFlagBits {
1061//}
1062
1063/// Buffer view creation flags
1064type VkFlags VkBufferViewCreateFlags
1065//bitfield VkBufferViewCreateFlagBits {
1066//}
1067
1068/// Pipeline cache creation flags
1069type VkFlags VkPipelineCacheCreateFlags
1070//bitfield VkPipelineCacheCreateFlagBits {
1071//}
1072
1073/// Pipeline shader stage creation flags
1074type VkFlags VkPipelineShaderStageCreateFlags
1075//bitfield VkPipelineShaderStageCreateFlagBits {
1076//}
1077
1078/// Descriptor set layout creation flags
1079type VkFlags VkDescriptorSetLayoutCreateFlags
1080//bitfield VkDescriptorSetLayoutCreateFlagBits {
1081//}
1082
1083/// Pipeline vertex input state creation flags
1084type VkFlags VkPipelineVertexInputStateCreateFlags
1085//bitfield VkPipelineVertexInputStateCreateFlagBits {
1086//}
1087
1088/// Pipeline input assembly state creation flags
1089type VkFlags VkPipelineInputAssemblyStateCreateFlags
1090//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1091//}
1092
1093/// Tessellation state creation flags
1094type VkFlags VkPipelineTessellationStateCreateFlags
1095//bitfield VkPipelineTessellationStateCreateFlagBits {
1096//}
1097
1098/// Viewport state creation flags
1099type VkFlags VkPipelineViewportStateCreateFlags
1100//bitfield VkPipelineViewportStateCreateFlagBits {
1101//}
1102
Jesse Hall3fbc8562015-11-29 22:10:52 -08001103/// Rasterization state creation flags
1104type VkFlags VkPipelineRasterizationStateCreateFlags
1105//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001106//}
1107
1108/// Multisample state creation flags
1109type VkFlags VkPipelineMultisampleStateCreateFlags
1110//bitfield VkPipelineMultisampleStateCreateFlagBits {
1111//}
1112
1113/// Color blend state creation flags
1114type VkFlags VkPipelineColorBlendStateCreateFlags
1115//bitfield VkPipelineColorBlendStateCreateFlagBits {
1116//}
1117
1118/// Depth/stencil state creation flags
1119type VkFlags VkPipelineDepthStencilStateCreateFlags
1120//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1121//}
1122
1123/// Dynamic state creation flags
1124type VkFlags VkPipelineDynamicStateCreateFlags
1125//bitfield VkPipelineDynamicStateCreateFlagBits {
1126//}
1127
1128/// Pipeline layout creation flags
1129type VkFlags VkPipelineLayoutCreateFlags
1130//bitfield VkPipelineLayoutCreateFlagBits {
1131//}
1132
1133/// Sampler creation flags
1134type VkFlags VkSamplerCreateFlags
1135//bitfield VkSamplerCreateFlagBits {
1136//}
1137
1138/// Render pass creation flags
1139type VkFlags VkRenderPassCreateFlags
1140//bitfield VkRenderPassCreateFlagBits {
1141//}
1142
1143/// Framebuffer creation flags
1144type VkFlags VkFramebufferCreateFlags
1145//bitfield VkFramebufferCreateFlagBits {
1146//}
1147
Jesse Halldc6d36c2015-11-29 19:12:15 -08001148/// Dependency flags
1149type VkFlags VkDependencyFlags
1150bitfield VkDependencyFlagBits {
1151 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1152}
1153
Jesse Hallc7467b72015-11-29 21:05:26 -08001154/// Cull mode flags
1155type VkFlags VkCullModeFlags
1156bitfield VkCullModeFlagBits {
1157 VK_CULL_MODE_NONE = 0x00000000,
1158 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1159 VK_CULL_MODE_BACK_BIT = 0x00000002,
1160 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1161}
1162
Jesse Hall523db342015-11-30 21:12:55 -08001163@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001164type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001165@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001166bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001167 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001168 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1169 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1170 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1171 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1172 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1173 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1174 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1175 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001176}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001177
Jesse Hall523db342015-11-30 21:12:55 -08001178@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001179type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001180@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001181bitfield VkCompositeAlphaFlagBitsKHR {
1182 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1183 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1184 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1185 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1186}
1187
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001188@extension("VK_KHR_swapchain")
1189type VkFlags VkSwapchainCreateFlagsKHR
1190//@extension("VK_KHR_swapchain")
1191//bitfield VkSwapchainCreateFlagBitsKHR {
1192//}
1193
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001194@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001195type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001196@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001197bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001198 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1199 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1200 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1201 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001202}
1203
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001204@extension("VK_KHR_display")
1205type VkFlags VkDisplaySurfaceCreateFlagsKHR
1206//@extension("VK_KHR_display")
1207//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1208//}
1209
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001210@extension("VK_KHR_display")
1211type VkFlags VkDisplayModeCreateFlagsKHR
1212//@extension("VK_KHR_display")
1213//bitfield VkDisplayModeCreateFlagBitsKHR {
1214//}
1215
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001216@extension("VK_KHR_xlib_surface")
1217type VkFlags VkXlibSurfaceCreateFlagsKHR
1218//@extension("VK_KHR_xlib_surface")
1219//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1220//}
1221
1222@extension("VK_KHR_xcb_surface")
1223type VkFlags VkXcbSurfaceCreateFlagsKHR
1224//@extension("VK_KHR_xcb_surface")
1225//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1226//}
1227
1228@extension("VK_KHR_wayland_surface")
1229type VkFlags VkWaylandSurfaceCreateFlagsKHR
1230//@extension("VK_KHR_wayland_surface")
1231//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1232//}
1233
1234@extension("VK_KHR_mir_surface")
1235type VkFlags VkMirSurfaceCreateFlagsKHR
1236//@extension("VK_KHR_mir_surface")
1237//bitfield VkMirSurfaceCreateFlagBitsKHR {
1238//}
1239
1240@extension("VK_KHR_android_surface")
1241type VkFlags VkAndroidSurfaceCreateFlagsKHR
1242//@extension("VK_KHR_android_surface")
1243//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1244//}
1245
1246@extension("VK_KHR_win32_surface")
1247type VkFlags VkWin32SurfaceCreateFlagsKHR
1248//@extension("VK_KHR_win32_surface")
1249//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1250//}
1251
Jesse Hall1356b0d2015-11-23 17:24:58 -08001252
Jesse Halld27f6aa2015-08-15 17:58:48 -07001253//////////////////
1254// Structures //
1255//////////////////
1256
1257class VkOffset2D {
1258 s32 x
1259 s32 y
1260}
1261
1262class VkOffset3D {
1263 s32 x
1264 s32 y
1265 s32 z
1266}
1267
1268class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001269 u32 width
1270 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001271}
1272
1273class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001274 u32 width
1275 u32 height
1276 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001277}
1278
1279class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001280 f32 x
1281 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001282 f32 width
1283 f32 height
1284 f32 minDepth
1285 f32 maxDepth
1286}
1287
1288class VkRect2D {
1289 VkOffset2D offset
1290 VkExtent2D extent
1291}
1292
Jesse Halla15a4bf2015-11-19 22:48:02 -08001293class VkClearRect {
1294 VkRect2D rect
1295 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001296 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001297}
1298
Jesse Hall65ab5522015-11-30 00:07:16 -08001299class VkComponentMapping {
1300 VkComponentSwizzle r
1301 VkComponentSwizzle g
1302 VkComponentSwizzle b
1303 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001304}
1305
1306class VkPhysicalDeviceProperties {
1307 u32 apiVersion
1308 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001309 u32 vendorID
1310 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001311 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001312 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1313 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001314 VkPhysicalDeviceLimits limits
1315 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001316}
1317
1318class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001319 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001320 u32 specVersion /// version of the extension specification implemented
1321}
1322
1323class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001324 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001325 u32 specVersion /// version of the layer specification implemented
1326 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001327 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001328}
1329
Jesse Halla366a512015-11-19 22:30:07 -08001330class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001331 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1332 const void* pNext /// Next structure in chain
1333 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001334 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001335 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001336 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001337 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001338 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001339 const VkSemaphore* pSignalSemaphores
1340}
1341
Jesse Halld27f6aa2015-08-15 17:58:48 -07001342class VkApplicationInfo {
1343 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1344 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001345 const char* pApplicationName
1346 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001347 const char* pEngineName
1348 u32 engineVersion
1349 u32 apiVersion
1350}
1351
Jesse Hall3fbc8562015-11-29 22:10:52 -08001352class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001353 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001354 PFN_vkAllocationFunction pfnAllocation
1355 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001356 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001357 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001358 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001359}
1360
1361class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001362 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1363 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001364 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001365 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001366 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001367 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001368}
1369
1370class VkDeviceCreateInfo {
1371 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1372 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001373 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001374 u32 queueCreateInfoCount
1375 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001376 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001377 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001378 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001379 const char* const* ppEnabledExtensionNames
1380 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001381}
1382
1383class VkInstanceCreateInfo {
1384 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1385 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001386 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001387 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001388 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001389 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001390 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001391 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1392}
1393
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001394class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001395 VkQueueFlags queueFlags /// Queue flags
1396 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001397 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001398 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001399}
1400
1401class VkPhysicalDeviceMemoryProperties {
1402 u32 memoryTypeCount
1403 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1404 u32 memoryHeapCount
1405 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1406}
1407
Jesse Hall3fbc8562015-11-29 22:10:52 -08001408class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001409 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001410 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001411 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001412 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1413}
1414
1415class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001416 VkDeviceSize size /// Specified in bytes
1417 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001418 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1419}
1420
1421class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001422 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001423 VkExtent3D imageGranularity
1424 VkSparseImageFormatFlags flags
1425}
1426
1427class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001428 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001429 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001430 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1431 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1432 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001433}
1434
1435class VkMemoryType {
1436 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1437 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1438}
1439
1440class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001441 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001442 VkMemoryHeapFlags flags /// Flags for the heap
1443}
1444
1445class VkMappedMemoryRange {
1446 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1447 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001448 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001449 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1450 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001451}
1452
1453class VkFormatProperties {
1454 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1455 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001456 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001457}
1458
1459class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001460 VkExtent3D maxExtent /// max image dimensions for this resource type
1461 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001462 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001463 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1464 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1465}
1466
Jesse Halla15a4bf2015-11-19 22:48:02 -08001467class VkDescriptorImageInfo {
1468 VkSampler sampler
1469 VkImageView imageView
1470 VkImageLayout imageLayout
1471}
1472
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001473class VkDescriptorBufferInfo {
1474 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1475 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1476 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001477}
1478
Jesse Halld27f6aa2015-08-15 17:58:48 -07001479class VkWriteDescriptorSet {
1480 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1481 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001482 VkDescriptorSet dstSet /// Destination descriptor set
1483 u32 dstBinding /// Binding within the destination descriptor set to write
1484 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001485 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001486 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 -08001487 const VkDescriptorImageInfo* pImageInfo
1488 const VkDescriptorBufferInfo* pBufferInfo
1489 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001490}
1491
1492class VkCopyDescriptorSet {
1493 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1494 const void* pNext /// Pointer to next structure
1495 VkDescriptorSet srcSet /// Source descriptor set
1496 u32 srcBinding /// Binding within the source descriptor set to copy from
1497 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001498 VkDescriptorSet dstSet /// Destination descriptor set
1499 u32 dstBinding /// Binding within the destination descriptor set to copy to
1500 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001501 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001502}
1503
1504class VkBufferCreateInfo {
1505 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1506 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001507 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001508 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001509 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001510 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001511 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001512 const u32* pQueueFamilyIndices
1513}
1514
1515class VkBufferViewCreateInfo {
1516 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1517 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001518 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001519 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001520 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001521 VkDeviceSize offset /// Specified in bytes
1522 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001523}
1524
1525class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001526 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001527 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001528 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001529}
1530
1531class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001532 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001533 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001534 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001535 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001536 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001537}
1538
1539class VkMemoryBarrier {
1540 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1541 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001542 VkAccessFlags srcAccessMask
1543 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001544}
1545
1546class VkBufferMemoryBarrier {
1547 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1548 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001549 VkAccessFlags srcAccessMask
1550 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001551 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001552 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001553 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001554 VkDeviceSize offset /// Offset within the buffer to sync
1555 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001556}
1557
1558class VkImageMemoryBarrier {
1559 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1560 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001561 VkAccessFlags srcAccessMask
1562 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001563 VkImageLayout oldLayout /// Current layout of the image
1564 VkImageLayout newLayout /// New layout to transition the image to
1565 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001566 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001567 VkImage image /// Image to sync
1568 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1569}
1570
1571class VkImageCreateInfo {
1572 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1573 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001574 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001575 VkImageType imageType
1576 VkFormat format
1577 VkExtent3D extent
1578 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001579 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001580 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001581 VkImageTiling tiling
1582 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001583 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001584 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001585 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001586 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001587}
1588
1589class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001590 VkDeviceSize offset /// Specified in bytes
1591 VkDeviceSize size /// Specified in bytes
1592 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001593 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001594 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001595}
1596
1597class VkImageViewCreateInfo {
1598 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1599 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001600 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001601 VkImage image
1602 VkImageViewType viewType
1603 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001604 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001605 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001606}
1607
1608class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001609 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001610 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001611 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001612}
1613
Jesse Halla6429252015-11-29 18:59:42 -08001614class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001615 VkDeviceSize resourceOffset /// Specified in bytes
1616 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001617 VkDeviceMemory memory
1618 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001619 VkSparseMemoryBindFlags flags
1620}
1621
Jesse Halla6429252015-11-29 18:59:42 -08001622class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001623 VkImageSubresource subresource
1624 VkOffset3D offset
1625 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001626 VkDeviceMemory memory
1627 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001628 VkSparseMemoryBindFlags flags
1629}
1630
Jesse Halla6429252015-11-29 18:59:42 -08001631class VkSparseBufferMemoryBindInfo {
1632 VkBuffer buffer
1633 u32 bindCount
1634 const VkSparseMemoryBind* pBinds
1635}
1636
1637class VkSparseImageOpaqueMemoryBindInfo {
1638 VkImage image
1639 u32 bindCount
1640 const VkSparseMemoryBind* pBinds
1641}
1642
1643class VkSparseImageMemoryBindInfo {
1644 VkImage image
1645 u32 bindCount
1646 const VkSparseMemoryBind* pBinds
1647}
1648
1649class VkBindSparseInfo {
1650 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1651 const void* pNext
1652 u32 waitSemaphoreCount
1653 const VkSemaphore* pWaitSemaphores
1654 u32 numBufferBinds
1655 const VkSparseBufferMemoryBindInfo* pBufferBinds
1656 u32 numImageOpaqueBinds
1657 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1658 u32 numImageBinds
1659 const VkSparseImageMemoryBindInfo* pImageBinds
1660 u32 signalSemaphoreCount
1661 const VkSemaphore* pSignalSemaphores
1662}
1663
Jesse Hall65ab5522015-11-30 00:07:16 -08001664class VkImageSubresourceLayers {
1665 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001666 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001667 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001668 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001669}
1670
Jesse Halld27f6aa2015-08-15 17:58:48 -07001671class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001672 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001673 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001674 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001675 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001676 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1677}
1678
1679class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001680 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001681 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08001682 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001683 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07001684}
1685
1686class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001687 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001688 u32 bufferRowLength /// Specified in texels
1689 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001690 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001691 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1692 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1693}
1694
1695class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001696 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001697 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001698 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001699 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001700 VkExtent3D extent
1701}
1702
1703class VkShaderModuleCreateInfo {
1704 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1705 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001706 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001707 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08001708 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07001709}
1710
Jesse Halld27f6aa2015-08-15 17:58:48 -07001711class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08001712 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001713 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08001714 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001715 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
1716 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
1717}
1718
1719class VkDescriptorSetLayoutCreateInfo {
1720 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
1721 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001722 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001723 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08001724 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001725}
1726
Jesse Hall65ab5522015-11-30 00:07:16 -08001727class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001728 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08001729 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001730}
1731
1732class VkDescriptorPoolCreateInfo {
1733 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
1734 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08001735 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001736 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08001737 u32 poolSizeCount
1738 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001739}
1740
Jesse Hall3fbc8562015-11-29 22:10:52 -08001741class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001742 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08001743 const void* pNext /// Pointer to next structure
1744 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08001745 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001746 const VkDescriptorSetLayout* pSetLayouts
1747}
1748
Jesse Halld27f6aa2015-08-15 17:58:48 -07001749class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08001750 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07001751 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08001752 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07001753}
1754
1755class VkSpecializationInfo {
1756 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08001757 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07001758 platform.size_t dataSize /// Size in bytes of pData
1759 const void* pData /// Pointer to SpecConstant data
1760}
1761
1762class VkPipelineShaderStageCreateInfo {
1763 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
1764 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001765 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001766 VkShaderStageFlagBits stage
1767 VkShaderModule module
1768 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07001769 const VkSpecializationInfo* pSpecializationInfo
1770}
1771
1772class VkComputePipelineCreateInfo {
1773 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
1774 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001775 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001776 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001777 VkPipelineLayout layout /// Interface layout of the pipeline
1778 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
1779 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
1780}
1781
1782class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001783 u32 binding /// Vertex buffer binding id
1784 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08001785 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07001786}
1787
1788class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001789 u32 location /// location of the shader vertex attrib
1790 u32 binding /// Vertex buffer binding id
1791 VkFormat format /// format of source data
1792 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001793}
1794
1795class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001796 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
1797 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001798 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001799 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001800 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08001801 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001802 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1803}
1804
1805class VkPipelineInputAssemblyStateCreateInfo {
1806 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
1807 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001808 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001809 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001810 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001811}
1812
1813class VkPipelineTessellationStateCreateInfo {
1814 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
1815 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001816 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001817 u32 patchControlPoints
1818}
1819
1820class VkPipelineViewportStateCreateInfo {
1821 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
1822 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001823 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001824 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001825 const VkViewport* pViewports
1826 u32 scissorCount
1827 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07001828}
1829
Jesse Hall3fbc8562015-11-29 22:10:52 -08001830class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08001831 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001832 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001833 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001834 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001835 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001836 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08001837 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07001838 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001839 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08001840 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001841 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08001842 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001843 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001844}
1845
1846class VkPipelineMultisampleStateCreateInfo {
1847 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
1848 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001849 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001850 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001851 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001852 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001853 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08001854 VkBool32 alphaToCoverageEnable
1855 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001856}
1857
1858class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001859 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001860 VkBlendFactor srcColorBlendFactor
1861 VkBlendFactor dstColorBlendFactor
1862 VkBlendOp colorBlendOp
1863 VkBlendFactor srcAlphaBlendFactor
1864 VkBlendFactor dstAlphaBlendFactor
1865 VkBlendOp alphaBlendOp
1866 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001867}
1868
1869class VkPipelineColorBlendStateCreateInfo {
1870 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
1871 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001872 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001873 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001874 VkLogicOp logicOp
1875 u32 attachmentCount /// # of pAttachments
1876 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08001877 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07001878}
1879
1880class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08001881 VkStencilOp failOp
1882 VkStencilOp passOp
1883 VkStencilOp depthFailOp
1884 VkCompareOp compareOp
1885 u32 compareMask
1886 u32 writeMask
1887 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07001888}
1889
1890class VkPipelineDepthStencilStateCreateInfo {
1891 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
1892 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001893 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001894 VkBool32 depthTestEnable
1895 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001896 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001897 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
1898 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001899 VkStencilOpState front
1900 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001901 f32 minDepthBounds
1902 f32 maxDepthBounds
1903}
1904
1905class VkPipelineDynamicStateCreateInfo {
1906 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
1907 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001908 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001909 u32 dynamicStateCount
1910 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001911}
1912
1913class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08001914 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
1915 const void* pNext /// Pointer to next structure
1916 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001917 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08001918 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001919 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
1920 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
1921 const VkPipelineTessellationStateCreateInfo* pTessellationState
1922 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08001923 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07001924 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
1925 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
1926 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001927 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08001928 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001929 VkRenderPass renderPass
1930 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08001931 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
1932 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 -07001933}
1934
1935class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08001936 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
1937 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001938 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08001939 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
1940 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07001941}
1942
1943class VkPushConstantRange {
1944 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08001945 u32 offset /// Start of the range, in bytes
1946 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001947}
1948
1949class VkPipelineLayoutCreateInfo {
1950 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
1951 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001952 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08001953 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001954 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
1955 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
1956 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
1957}
1958
1959class VkSamplerCreateInfo {
1960 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
1961 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001962 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08001963 VkFilter magFilter /// Filter mode for magnification
1964 VkFilter minFilter /// Filter mode for minifiation
1965 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
1966 VkSamplerAddressMode addressModeU
1967 VkSamplerAddressMode addressModeV
1968 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07001969 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001970 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001971 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001972 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001973 VkCompareOp compareOp
1974 f32 minLod
1975 f32 maxLod
1976 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001977 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001978}
1979
Jesse Hall3fbc8562015-11-29 22:10:52 -08001980class VkCommandPoolCreateInfo {
1981 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001982 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001983 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001984 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001985}
1986
Jesse Hall3fbc8562015-11-29 22:10:52 -08001987class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001988 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001989 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001990 VkCommandPool commandPool
1991 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08001992 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001993}
1994
Jesse Hall3dd678a2016-01-08 21:52:01 -08001995class VkCommandBufferInheritanceInfo {
1996 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001997 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001998 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001999 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002000 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002001 VkBool32 occlusionQueryEnable
2002 VkQueryControlFlags queryFlags
2003 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002004}
2005
Jesse Hall3dd678a2016-01-08 21:52:01 -08002006class VkCommandBufferBeginInfo {
2007 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2008 const void* pNext /// Pointer to next structure
2009 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2010 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2011}
2012
Jesse Halld27f6aa2015-08-15 17:58:48 -07002013class VkRenderPassBeginInfo {
2014 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2015 const void* pNext /// Pointer to next structure
2016 VkRenderPass renderPass
2017 VkFramebuffer framebuffer
2018 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002019 u32 clearValueCount
2020 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002021}
2022
2023@union
2024/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2025class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002026 f32[4] float32
2027 s32[4] int32
2028 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002029}
2030
2031class VkClearDepthStencilValue {
2032 f32 depth
2033 u32 stencil
2034}
2035
2036@union
2037/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2038class VkClearValue {
2039 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002040 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002041}
2042
Jesse Hallae38f732015-11-19 21:32:50 -08002043class VkClearAttachment {
2044 VkImageAspectFlags aspectMask
2045 u32 colorAttachment
2046 VkClearValue clearValue
2047}
2048
Jesse Halld27f6aa2015-08-15 17:58:48 -07002049class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002050 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002051 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002052 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002053 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2054 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2055 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2056 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2057 VkImageLayout initialLayout
2058 VkImageLayout finalLayout
2059}
2060
2061class VkAttachmentReference {
2062 u32 attachment
2063 VkImageLayout layout
2064}
2065
2066class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002067 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002068 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002069 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002070 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002071 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002072 const VkAttachmentReference* pColorAttachments
2073 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002074 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002075 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002076 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002077}
2078
2079class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002080 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002081 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002082 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002083 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002084 VkAccessFlags srcAccessMask
2085 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002086 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002087}
2088
2089class VkRenderPassCreateInfo {
2090 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2091 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002092 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002093 u32 attachmentCount
2094 const VkAttachmentDescription* pAttachments
2095 u32 subpassCount
2096 const VkSubpassDescription* pSubpasses
2097 u32 dependencyCount
2098 const VkSubpassDependency* pDependencies
2099}
2100
2101class VkEventCreateInfo {
2102 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2103 const void* pNext /// Pointer to next structure
2104 VkEventCreateFlags flags /// Event creation flags
2105}
2106
2107class VkFenceCreateInfo {
2108 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2109 const void* pNext /// Pointer to next structure
2110 VkFenceCreateFlags flags /// Fence creation flags
2111}
2112
2113class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002114 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2115 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2116 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2117 VkBool32 independentBlend /// blending operations are controlled per-attachment
2118 VkBool32 geometryShader /// geometry stage
2119 VkBool32 tessellationShader /// tessellation control and evaluation stage
2120 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002121 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002122 VkBool32 logicOp /// logic operations
2123 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002124 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002125 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002126 VkBool32 depthBiasClamp /// depth bias clamping
2127 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2128 VkBool32 depthBounds /// depth bounds test
2129 VkBool32 wideLines /// lines with width greater than 1
2130 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002131 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2132 VkBool32 multiViewport
2133 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002134 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2135 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2136 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002137 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002138 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002139 VkBool32 vertexPipelineStoresAndAtomics
2140 VkBool32 fragmentStoresAndAtomics
2141 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002142 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2143 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2144 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002145 VkBool32 shaderStorageImageReadWithoutFormat
2146 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002147 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2148 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2149 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2150 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2151 VkBool32 shaderClipDistance /// clip distance in shaders
2152 VkBool32 shaderCullDistance /// cull distance in shaders
2153 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2154 VkBool32 shaderInt64 /// 64-bit integers in shaders
2155 VkBool32 shaderInt16 /// 16-bit integers in shaders
2156 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002157 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002158 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2159 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2160 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2161 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2162 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2163 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2164 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2165 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2166 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002167 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002168 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002169}
2170
2171class VkPhysicalDeviceLimits {
2172 /// resource maximum sizes
2173 u32 maxImageDimension1D /// max 1D image dimension
2174 u32 maxImageDimension2D /// max 2D image dimension
2175 u32 maxImageDimension3D /// max 3D image dimension
2176 u32 maxImageDimensionCube /// max cubemap image dimension
2177 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002178 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002179 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2180 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002181 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2182 /// memory limits
2183 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002184 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002185 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2186 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002187 /// descriptor set limits
2188 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002189 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2190 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2191 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2192 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2193 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002194 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002195 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002196 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2197 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002198 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002199 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002200 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002201 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2202 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002203 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002204 /// vertex stage limits
2205 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002206 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002207 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2208 u32 maxVertexInputBindingStride /// max vertex input binding stride
2209 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2210 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002211 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002212 u32 maxTessellationPatchSize /// max patch size (vertices)
2213 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2214 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2215 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2216 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2217 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2218 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002219 /// geometry stage limits
2220 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2221 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2222 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2223 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2224 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2225 /// fragment stage limits
2226 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002227 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002228 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002229 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2230 /// compute stage limits
2231 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2232 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2233 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2234 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2235
2236 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2237 u32 subTexelPrecisionBits /// num bits of subtexel precision
2238 u32 mipmapPrecisionBits /// num bits of mipmap precision
2239
2240 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002241 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002242
2243 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2244 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2245
2246 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002247 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2248 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2249 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2250
Jesse Halldc6d36c2015-11-29 19:12:15 -08002251 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2252 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2253 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2254 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002255
Jesse Hallfbf97b02015-11-20 14:17:03 -08002256 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002257 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002258 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002259 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2260 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2261 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2262 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2263
2264 u32 maxFramebufferWidth /// max width for a framebuffer
2265 u32 maxFramebufferHeight /// max height for a framebuffer
2266 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002267 VkSampleCountFlags framebufferColorSampleCounts
2268 VkSampleCountFlags framebufferDepthSampleCounts
2269 VkSampleCountFlags framebufferStencilSampleCounts
2270 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002271 u32 maxColorAttachments /// max num of framebuffer color attachments
2272
Jesse Hall091ed9e2015-11-30 00:55:29 -08002273 VkSampleCountFlags sampledImageColorSampleCounts
2274 VkSampleCountFlags sampledImageIntegerSampleCounts
2275 VkSampleCountFlags sampledImageDepthSampleCounts
2276 VkSampleCountFlags sampledImageStencilSampleCounts
2277 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002278 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002279 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002280
Jesse Halla9bb62b2015-11-21 19:31:56 -08002281 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002282
2283 u32 maxClipDistances /// max number of clip distances
2284 u32 maxCullDistances /// max number of cull distances
2285 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2286
Jesse Hallfbf97b02015-11-20 14:17:03 -08002287 u32 discreteQueuePriorities
2288
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002289 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2290 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002291 f32 pointSizeGranularity /// granularity of supported point sizes
2292 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002293 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002294 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002295
Jesse Hall65ab5522015-11-30 00:07:16 -08002296 VkDeviceSize optimalBufferCopyOffsetAlignment
2297 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002298 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002299}
2300
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002301class VkPhysicalDeviceSparseProperties {
2302 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 -08002303 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 -07002304 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2305 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 -07002306 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
2307}
2308
Jesse Halld27f6aa2015-08-15 17:58:48 -07002309class VkSemaphoreCreateInfo {
2310 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2311 const void* pNext /// Pointer to next structure
2312 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2313}
2314
2315class VkQueryPoolCreateInfo {
2316 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2317 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002318 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002319 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002320 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002321 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2322}
2323
2324class VkFramebufferCreateInfo {
2325 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2326 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002327 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002328 VkRenderPass renderPass
2329 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002330 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002331 u32 width
2332 u32 height
2333 u32 layers
2334}
2335
Jesse Hall3fbc8562015-11-29 22:10:52 -08002336class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002337 u32 vertexCount
2338 u32 instanceCount
2339 u32 firstVertex
2340 u32 firstInstance
2341}
2342
Jesse Hall3fbc8562015-11-29 22:10:52 -08002343class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002344 u32 indexCount
2345 u32 instanceCount
2346 u32 firstIndex
2347 s32 vertexOffset
2348 u32 firstInstance
2349}
2350
Jesse Hall3fbc8562015-11-29 22:10:52 -08002351class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002352 u32 x
2353 u32 y
2354 u32 z
2355}
2356
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002357@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002358class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002359 u32 minImageCount
2360 u32 maxImageCount
2361 VkExtent2D currentExtent
2362 VkExtent2D minImageExtent
2363 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002364 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002365 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002366 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002367 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002368 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002369}
2370
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002371@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002372class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002373 VkFormat format
2374 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002375}
2376
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002377@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002378class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002379 VkStructureType sType
2380 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002381 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002382 VkSurfaceKHR surface
2383 u32 minImageCount
2384 VkFormat imageFormat
2385 VkColorSpaceKHR imageColorSpace
2386 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002387 u32 imageArrayLayers
2388 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002389 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002390 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002391 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002392 VkSurfaceTransformFlagBitsKHR preTransform
2393 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002394 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002395 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002396 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002397}
2398
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002399@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002400class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002401 VkStructureType sType
2402 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002403 u32 waitSemaphoreCount
2404 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002405 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002406 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002407 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002408 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002409}
2410
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002411@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002412class VkDisplayPropertiesKHR {
2413 VkDisplayKHR display
2414 const char* displayName
2415 VkExtent2D physicalDimensions
2416 VkExtent2D physicalResolution
2417 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002418 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002419 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002420}
2421
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002422@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002423class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002424 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002425 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002426}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002427
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002428@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002429class VkDisplayModePropertiesKHR {
2430 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002431 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002432}
2433
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002434@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002435class VkDisplayModeCreateInfoKHR {
2436 VkStructureType sType
2437 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002438 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002439 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002440}
2441
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002442@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002443class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002444 VkDisplayKHR currentDisplay
2445 u32 currentStackIndex
2446}
2447
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002448@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002449class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002450 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2451 VkOffset2D minSrcPosition
2452 VkOffset2D maxSrcPosition
2453 VkExtent2D minSrcExtent
2454 VkExtent2D maxSrcExtent
2455 VkOffset2D minDstPosition
2456 VkOffset2D maxDstPosition
2457 VkExtent2D minDstExtent
2458 VkExtent2D maxDstExtent
2459}
2460
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002461@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002462class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002463 VkStructureType sType
2464 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002465 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002466 VkDisplayModeKHR displayMode
2467 u32 planeIndex
2468 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002469 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002470 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002471 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2472 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002473}
2474
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002475@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002476class VkDisplayPresentInfoKHR {
2477 VkStructureType sType
2478 const void* pNext
2479 VkRect2D srcRect
2480 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002481 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002482}
2483
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002484@extension("VK_KHR_xlib_surface")
2485class VkXlibSurfaceCreateInfoKHR {
2486 VkStructureType sType
2487 const void* pNext
2488 VkXlibSurfaceCreateFlagsKHR flags
2489 platform.Display* dpy
2490 platform.Window window
2491}
2492
2493@extension("VK_KHR_xcb_surface")
2494class VkXcbSurfaceCreateInfoKHR {
2495 VkStructureType sType
2496 const void* pNext
2497 VkXcbSurfaceCreateFlagsKHR flags
2498 platform.xcb_connection_t* connection
2499 platform.xcb_window_t window
2500}
2501
2502@extension("VK_KHR_wayland_surface")
2503class VkWaylandSurfaceCreateInfoKHR {
2504 VkStructureType sType
2505 const void* pNext
2506 VkWaylandSurfaceCreateFlagsKHR flags
2507 platform.wl_display* display
2508 platform.wl_surface* surface
2509}
2510
2511@extension("VK_KHR_mir_surface")
2512class VkMirSurfaceCreateInfoKHR {
2513 VkStructureType sType
2514 const void* pNext
2515 VkMirSurfaceCreateFlagsKHR flags
2516 platform.MirConnection* connection
2517 platform.MirSurface* mirSurface
2518}
2519
2520@extension("VK_KHR_android_surface")
2521class VkAndroidSurfaceCreateInfoKHR {
2522 VkStructureType sType
2523 const void* pNext
2524 VkAndroidSurfaceCreateFlagsKHR flags
2525 platform.ANativeWindow* window
2526}
2527
2528@extension("VK_KHR_win32_surface")
2529class VkWin32SurfaceCreateInfoKHR {
2530 VkStructureType sType
2531 const void* pNext
2532 VkWin32SurfaceCreateFlagsKHR flags
2533 platform.HINSTANCE hinstance
2534 platform.HWND hwnd
2535}
2536
Jesse Hall1356b0d2015-11-23 17:24:58 -08002537
Jesse Halld27f6aa2015-08-15 17:58:48 -07002538////////////////
2539// Commands //
2540////////////////
2541
2542// Function pointers. TODO: add support for function pointers.
2543
2544@external type void* PFN_vkVoidFunction
2545@pfn cmd void vkVoidFunction() {
2546}
2547
Jesse Hall3fbc8562015-11-29 22:10:52 -08002548@external type void* PFN_vkAllocationFunction
2549@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002550 void* pUserData,
2551 platform.size_t size,
2552 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002553 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002554 return ?
2555}
2556
Jesse Hall3fbc8562015-11-29 22:10:52 -08002557@external type void* PFN_vkReallocationFunction
2558@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002559 void* pUserData,
2560 void* pOriginal,
2561 platform.size_t size,
2562 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002563 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002564 return ?
2565}
2566
2567@external type void* PFN_vkFreeFunction
2568@pfn cmd void vkFreeFunction(
2569 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002570 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002571}
2572
Jesse Hall3fbc8562015-11-29 22:10:52 -08002573@external type void* PFN_vkInternalAllocationNotification
2574@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002575 void* pUserData,
2576 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002577 VkInternalAllocationType allocationType,
2578 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002579}
2580
2581@external type void* PFN_vkInternalFreeNotification
2582@pfn cmd void vkInternalFreeNotification(
2583 void* pUserData,
2584 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002585 VkInternalAllocationType allocationType,
2586 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002587}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002588
2589// Global functions
2590
2591@threadSafety("system")
2592cmd VkResult vkCreateInstance(
2593 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002594 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002595 VkInstance* pInstance) {
2596 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
2597
2598 instance := ?
2599 pInstance[0] = instance
2600 State.Instances[instance] = new!InstanceObject()
2601
Jesse Hall3dd678a2016-01-08 21:52:01 -08002602 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
2603 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07002604
2605 return ?
2606}
2607
2608@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002609cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002610 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002611 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002612 instanceObject := GetInstance(instance)
2613
2614 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002615}
2616
2617@threadSafety("system")
2618cmd VkResult vkEnumeratePhysicalDevices(
2619 VkInstance instance,
2620 u32* pPhysicalDeviceCount,
2621 VkPhysicalDevice* pPhysicalDevices) {
2622 instanceObject := GetInstance(instance)
2623
2624 physicalDeviceCount := as!u32(?)
2625 pPhysicalDeviceCount[0] = physicalDeviceCount
2626 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
2627
2628 for i in (0 .. physicalDeviceCount) {
2629 physicalDevice := ?
2630 physicalDevices[i] = physicalDevice
2631 if !(physicalDevice in State.PhysicalDevices) {
2632 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
2633 }
2634 }
2635
2636 return ?
2637}
2638
2639cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
2640 VkDevice device,
2641 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002642 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002643 device := GetDevice(device)
2644 }
2645
2646 return ?
2647}
2648
2649cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
2650 VkInstance instance,
2651 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002652 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002653 instanceObject := GetInstance(instance)
2654 }
2655
2656 return ?
2657}
2658
Jesse Hall606a54e2015-11-19 22:17:28 -08002659cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002660 VkPhysicalDevice physicalDevice,
2661 VkPhysicalDeviceProperties* pProperties) {
2662 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2663
2664 properties := ?
2665 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002666}
2667
Jesse Hall606a54e2015-11-19 22:17:28 -08002668cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002669 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002670 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002671 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002672 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002673 // TODO: Figure out how to express fetch-count-or-properties
2674 // This version fails 'apic validate' with 'fence not allowed in
2675 // *semantic.Branch'. Other attempts have failed with the same or other
2676 // errors.
2677 // if pQueueFamilyProperties != null {
2678 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
2679 // for i in (0 .. pCount[0]) {
2680 // queueProperties := as!VkQueueFamilyProperties(?)
2681 // queuesProperties[i] = queueProperties
2682 // }
2683 // } else {
2684 // count := ?
2685 // pCount[0] = count
2686 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002687}
2688
Jesse Hall606a54e2015-11-19 22:17:28 -08002689cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002690 VkPhysicalDevice physicalDevice,
2691 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
2692 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2693
2694 memoryProperties := ?
2695 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002696}
2697
Jesse Hall606a54e2015-11-19 22:17:28 -08002698cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002699 VkPhysicalDevice physicalDevice,
2700 VkPhysicalDeviceFeatures* pFeatures) {
2701 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2702
2703 features := ?
2704 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07002705}
2706
Jesse Hall606a54e2015-11-19 22:17:28 -08002707cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002708 VkPhysicalDevice physicalDevice,
2709 VkFormat format,
2710 VkFormatProperties* pFormatProperties) {
2711 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2712
2713 formatProperties := ?
2714 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002715}
2716
Jesse Halla9e57032015-11-30 01:03:10 -08002717cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002718 VkPhysicalDevice physicalDevice,
2719 VkFormat format,
2720 VkImageType type,
2721 VkImageTiling tiling,
2722 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002723 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002724 VkImageFormatProperties* pImageFormatProperties) {
2725 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2726
2727 imageFormatProperties := ?
2728 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08002729
2730 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07002731}
2732
Jesse Halld27f6aa2015-08-15 17:58:48 -07002733
2734// Device functions
2735
2736@threadSafety("system")
2737cmd VkResult vkCreateDevice(
2738 VkPhysicalDevice physicalDevice,
2739 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002740 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002741 VkDevice* pDevice) {
2742 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
2743 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2744
2745 device := ?
2746 pDevice[0] = device
2747 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
2748
2749 return ?
2750}
2751
2752@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002753cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002754 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002755 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002756 deviceObject := GetDevice(device)
2757
2758 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002759}
2760
2761
2762// Extension discovery functions
2763
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002764cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002765 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002766 VkLayerProperties* pProperties) {
2767 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002768 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002769
2770 properties := pProperties[0:count]
2771 for i in (0 .. count) {
2772 property := ?
2773 properties[i] = property
2774 }
2775
2776 return ?
2777}
2778
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002779cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002780 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002781 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002782 VkExtensionProperties* pProperties) {
2783 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002784 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002785
2786 properties := pProperties[0:count]
2787 for i in (0 .. count) {
2788 property := ?
2789 properties[i] = property
2790 }
2791
2792 return ?
2793}
2794
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002795cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002796 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002797 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002798 VkLayerProperties* pProperties) {
2799 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2800 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002801 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002802
2803 properties := pProperties[0:count]
2804 for i in (0 .. count) {
2805 property := ?
2806 properties[i] = property
2807 }
2808
2809 return ?
2810}
2811
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002812cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002813 VkPhysicalDevice physicalDevice,
2814 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002815 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002816 VkExtensionProperties* pProperties) {
2817 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2818
2819 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002820 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002821
2822 properties := pProperties[0:count]
2823 for i in (0 .. count) {
2824 property := ?
2825 properties[i] = property
2826 }
2827
2828 return ?
2829}
2830
2831
2832// Queue functions
2833
2834@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08002835cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002836 VkDevice device,
2837 u32 queueFamilyIndex,
2838 u32 queueIndex,
2839 VkQueue* pQueue) {
2840 deviceObject := GetDevice(device)
2841
2842 queue := ?
2843 pQueue[0] = queue
2844
2845 if !(queue in State.Queues) {
2846 State.Queues[queue] = new!QueueObject(device: device)
2847 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002848}
2849
2850@threadSafety("app")
2851cmd VkResult vkQueueSubmit(
2852 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08002853 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08002854 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002855 VkFence fence) {
2856 queueObject := GetQueue(queue)
2857
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002858 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002859 fenceObject := GetFence(fence)
2860 assert(fenceObject.device == queueObject.device)
2861 }
2862
Jesse Hall3fbc8562015-11-29 22:10:52 -08002863 // commandBuffers := pcommandBuffers[0:commandBufferCount]
2864 // for i in (0 .. commandBufferCount) {
2865 // commandBuffer := commandBuffers[i]
2866 // commandBufferObject := GetCommandBuffer(commandBuffer)
2867 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08002868 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08002869 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
2870 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08002871 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002872
2873 return ?
2874}
2875
2876@threadSafety("system")
2877cmd VkResult vkQueueWaitIdle(
2878 VkQueue queue) {
2879 queueObject := GetQueue(queue)
2880
2881 return ?
2882}
2883
2884@threadSafety("system")
2885cmd VkResult vkDeviceWaitIdle(
2886 VkDevice device) {
2887 deviceObject := GetDevice(device)
2888
2889 return ?
2890}
2891
2892
2893// Memory functions
2894
2895@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002896cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002897 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002898 const VkMemoryAllocateInfo* pAllocateInfo,
2899 const VkAllocationCallbacks* pAllocator,
2900 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002901 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002902 deviceObject := GetDevice(device)
2903
Jesse Hall3fbc8562015-11-29 22:10:52 -08002904 memory := ?
2905 pMemory[0] = memory
2906 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002907 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002908 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002909
2910 return ?
2911}
2912
2913@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002914cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002915 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002916 VkDeviceMemory memory,
2917 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002918 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002919 memoryObject := GetDeviceMemory(memory)
2920 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002921
2922 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08002923 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002924 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002925 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
2926 "vkFreeMemory: commandBuffers still bound")
2927 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002928}
2929
2930@threadSafety("app")
2931cmd VkResult vkMapMemory(
2932 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002933 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002934 VkDeviceSize offset,
2935 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002936 VkMemoryMapFlags flags,
2937 void** ppData) {
2938 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002939 memoryObject := GetDeviceMemory(memory)
2940 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002941
2942 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08002943 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002944
2945 return ?
2946}
2947
2948@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002949cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002950 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002951 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002952 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002953 memoryObject := GetDeviceMemory(memory)
2954 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002955}
2956
2957cmd VkResult vkFlushMappedMemoryRanges(
2958 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002959 u32 memoryRangeCount
2960 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002961 deviceObject := GetDevice(device)
2962
Jesse Hall3fbc8562015-11-29 22:10:52 -08002963 memoryRanges := pMemoryRanges[0:memoryRangeCount]
2964 for i in (0 .. memoryRangeCount) {
2965 memoryRange := memoryRanges[i]
2966 memoryObject := GetDeviceMemory(memoryRange.memory)
2967 assert(memoryObject.device == device)
2968 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002969 }
2970
2971 return ?
2972}
2973
2974cmd VkResult vkInvalidateMappedMemoryRanges(
2975 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002976 u32 memoryRangeCount,
2977 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002978 deviceObject := GetDevice(device)
2979
Jesse Hall3fbc8562015-11-29 22:10:52 -08002980 memoryRanges := pMemoryRanges[0:memoryRangeCount]
2981 for i in (0 .. memoryRangeCount) {
2982 memoryRange := memoryRanges[i]
2983 memoryObject := GetDeviceMemory(memoryRange.memory)
2984 assert(memoryObject.device == device)
2985 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002986 }
2987
2988 return ?
2989}
2990
2991
2992// Memory management API functions
2993
Jesse Hall606a54e2015-11-19 22:17:28 -08002994cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002995 VkDevice device,
2996 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002997 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002998 deviceObject := GetDevice(device)
2999
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003000 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003001 memoryObject := GetDeviceMemory(memory)
3002 assert(memoryObject.device == device)
3003 }
3004
3005 committedMemoryInBytes := ?
3006 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003007}
3008
Jesse Hall606a54e2015-11-19 22:17:28 -08003009cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003010 VkDevice device,
3011 VkBuffer buffer,
3012 VkMemoryRequirements* pMemoryRequirements) {
3013 deviceObject := GetDevice(device)
3014 bufferObject := GetBuffer(buffer)
3015 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003016}
3017
3018cmd VkResult vkBindBufferMemory(
3019 VkDevice device,
3020 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003021 VkDeviceMemory memory,
3022 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003023 deviceObject := GetDevice(device)
3024 bufferObject := GetBuffer(buffer)
3025 assert(bufferObject.device == device)
3026
3027 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003028 if bufferObject.memory != NULL_HANDLE {
3029 memoryObject := GetDeviceMemory(bufferObject.memory)
3030 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003031 }
3032
3033 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003034 if memory != NULL_HANDLE {
3035 memoryObject := GetDeviceMemory(memory)
3036 assert(memoryObject.device == device)
3037 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003038 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003039 bufferObject.memory = memory
3040 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003041
3042 return ?
3043}
3044
Jesse Hall606a54e2015-11-19 22:17:28 -08003045cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003046 VkDevice device,
3047 VkImage image,
3048 VkMemoryRequirements* pMemoryRequirements) {
3049 deviceObject := GetDevice(device)
3050 imageObject := GetImage(image)
3051 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003052}
3053
3054cmd VkResult vkBindImageMemory(
3055 VkDevice device,
3056 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003057 VkDeviceMemory memory,
3058 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003059 deviceObject := GetDevice(device)
3060 imageObject := GetImage(image)
3061 assert(imageObject.device == device)
3062
3063 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003064 if imageObject.memory != NULL_HANDLE {
3065 memoryObject := GetDeviceMemory(imageObject.memory)
3066 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003067 }
3068
3069 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003070 if memory != NULL_HANDLE {
3071 memoryObject := GetDeviceMemory(memory)
3072 assert(memoryObject.device == device)
3073 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003074 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003075 imageObject.memory = memory
3076 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003077
3078 return ?
3079}
3080
Jesse Hall606a54e2015-11-19 22:17:28 -08003081cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003082 VkDevice device,
3083 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003084 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003085 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3086 deviceObject := GetDevice(device)
3087 imageObject := GetImage(image)
3088 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003089}
3090
Jesse Hall606a54e2015-11-19 22:17:28 -08003091cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003092 VkPhysicalDevice physicalDevice,
3093 VkFormat format,
3094 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003095 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003096 VkImageUsageFlags usage,
3097 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003098 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003099 VkSparseImageFormatProperties* pProperties) {
3100 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003101}
3102
Jesse Halla6429252015-11-29 18:59:42 -08003103cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003104 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003105 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003106 const VkBindSparseInfo* pBindInfo,
3107 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003108 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003109
3110 return ?
3111}
3112
3113
3114// Fence functions
3115
3116@threadSafety("system")
3117cmd VkResult vkCreateFence(
3118 VkDevice device,
3119 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003120 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003121 VkFence* pFence) {
3122 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3123 deviceObject := GetDevice(device)
3124
3125 fence := ?
3126 pFence[0] = fence
3127 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003128 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003129
3130 return ?
3131}
3132
3133@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003134cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003135 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003136 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003137 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003138 deviceObject := GetDevice(device)
3139 fenceObject := GetFence(fence)
3140 assert(fenceObject.device == device)
3141
3142 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003143}
3144
3145@threadSafety("system")
3146cmd VkResult vkResetFences(
3147 VkDevice device,
3148 u32 fenceCount,
3149 const VkFence* pFences) {
3150 deviceObject := GetDevice(device)
3151
3152 fences := pFences[0:fenceCount]
3153 for i in (0 .. fenceCount) {
3154 fence := fences[i]
3155 fenceObject := GetFence(fence)
3156 assert(fenceObject.device == device)
3157 fenceObject.signaled = false
3158 }
3159
3160 return ?
3161}
3162
3163@threadSafety("system")
3164cmd VkResult vkGetFenceStatus(
3165 VkDevice device,
3166 VkFence fence) {
3167 deviceObject := GetDevice(device)
3168 fenceObject := GetFence(fence)
3169 assert(fenceObject.device == device)
3170
3171 return ?
3172}
3173
3174@threadSafety("system")
3175cmd VkResult vkWaitForFences(
3176 VkDevice device,
3177 u32 fenceCount,
3178 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003179 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003180 u64 timeout) { /// timeout in nanoseconds
3181 deviceObject := GetDevice(device)
3182
3183 fences := pFences[0:fenceCount]
3184 for i in (0 .. fenceCount) {
3185 fence := fences[i]
3186 fenceObject := GetFence(fence)
3187 assert(fenceObject.device == device)
3188 }
3189
3190 return ?
3191}
3192
3193
3194// Queue semaphore functions
3195
3196@threadSafety("system")
3197cmd VkResult vkCreateSemaphore(
3198 VkDevice device,
3199 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003200 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003201 VkSemaphore* pSemaphore) {
3202 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3203 deviceObject := GetDevice(device)
3204
3205 semaphore := ?
3206 pSemaphore[0] = semaphore
3207 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3208
3209 return ?
3210}
3211
3212@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003213cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003214 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003215 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003216 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003217 deviceObject := GetDevice(device)
3218 semaphoreObject := GetSemaphore(semaphore)
3219 assert(semaphoreObject.device == device)
3220
3221 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003222}
3223
Jesse Halld27f6aa2015-08-15 17:58:48 -07003224
3225// Event functions
3226
3227@threadSafety("system")
3228cmd VkResult vkCreateEvent(
3229 VkDevice device,
3230 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003231 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003232 VkEvent* pEvent) {
3233 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3234 deviceObject := GetDevice(device)
3235
3236 event := ?
3237 pEvent[0] = event
3238 State.Events[event] = new!EventObject(device: device)
3239
3240 return ?
3241}
3242
3243@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003244cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003245 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003246 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003247 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003248 deviceObject := GetDevice(device)
3249 eventObject := GetEvent(event)
3250 assert(eventObject.device == device)
3251
3252 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003253}
3254
3255@threadSafety("system")
3256cmd VkResult vkGetEventStatus(
3257 VkDevice device,
3258 VkEvent event) {
3259 deviceObject := GetDevice(device)
3260 eventObject := GetEvent(event)
3261 assert(eventObject.device == device)
3262
3263 return ?
3264}
3265
3266@threadSafety("system")
3267cmd VkResult vkSetEvent(
3268 VkDevice device,
3269 VkEvent event) {
3270 deviceObject := GetDevice(device)
3271 eventObject := GetEvent(event)
3272 assert(eventObject.device == device)
3273
3274 return ?
3275}
3276
3277@threadSafety("system")
3278cmd VkResult vkResetEvent(
3279 VkDevice device,
3280 VkEvent event) {
3281 deviceObject := GetDevice(device)
3282 eventObject := GetEvent(event)
3283 assert(eventObject.device == device)
3284
3285 return ?
3286}
3287
3288
3289// Query functions
3290
3291@threadSafety("system")
3292cmd VkResult vkCreateQueryPool(
3293 VkDevice device,
3294 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003295 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003296 VkQueryPool* pQueryPool) {
3297 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3298 deviceObject := GetDevice(device)
3299
3300 queryPool := ?
3301 pQueryPool[0] = queryPool
3302 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3303
3304 return ?
3305}
3306
3307@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003308cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003309 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003310 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003311 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003312 deviceObject := GetDevice(device)
3313 queryPoolObject := GetQueryPool(queryPool)
3314 assert(queryPoolObject.device == device)
3315
3316 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003317}
3318
3319@threadSafety("system")
3320cmd VkResult vkGetQueryPoolResults(
3321 VkDevice device,
3322 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003323 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003324 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003325 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003326 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003327 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003328 VkQueryResultFlags flags) {
3329 deviceObject := GetDevice(device)
3330 queryPoolObject := GetQueryPool(queryPool)
3331 assert(queryPoolObject.device == device)
3332
Jesse Halld27f6aa2015-08-15 17:58:48 -07003333 data := pData[0:dataSize]
3334
3335 return ?
3336}
3337
3338// Buffer functions
3339
3340@threadSafety("system")
3341cmd VkResult vkCreateBuffer(
3342 VkDevice device,
3343 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003344 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003345 VkBuffer* pBuffer) {
3346 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3347 deviceObject := GetDevice(device)
3348
3349 buffer := ?
3350 pBuffer[0] = buffer
3351 State.Buffers[buffer] = new!BufferObject(device: device)
3352
3353 return ?
3354}
3355
3356@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003357cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003358 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003359 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003360 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003361 deviceObject := GetDevice(device)
3362 bufferObject := GetBuffer(buffer)
3363 assert(bufferObject.device == device)
3364
Jesse Hall3fbc8562015-11-29 22:10:52 -08003365 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003366 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003367}
3368
3369
3370// Buffer view functions
3371
3372@threadSafety("system")
3373cmd VkResult vkCreateBufferView(
3374 VkDevice device,
3375 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003376 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003377 VkBufferView* pView) {
3378 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3379 deviceObject := GetDevice(device)
3380
3381 bufferObject := GetBuffer(pCreateInfo.buffer)
3382 assert(bufferObject.device == device)
3383
3384 view := ?
3385 pView[0] = view
3386 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3387
3388 return ?
3389}
3390
3391@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003392cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003393 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003394 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003395 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003396 deviceObject := GetDevice(device)
3397 bufferViewObject := GetBufferView(bufferView)
3398 assert(bufferViewObject.device == device)
3399
3400 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003401}
3402
3403
3404// Image functions
3405
3406@threadSafety("system")
3407cmd VkResult vkCreateImage(
3408 VkDevice device,
3409 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003410 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003411 VkImage* pImage) {
3412 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3413 deviceObject := GetDevice(device)
3414
3415 image := ?
3416 pImage[0] = image
3417 State.Images[image] = new!ImageObject(device: device)
3418
3419 return ?
3420}
3421
3422@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003423cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003424 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003425 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003426 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003427 deviceObject := GetDevice(device)
3428 imageObject := GetImage(image)
3429 assert(imageObject.device == device)
3430
Jesse Hall3fbc8562015-11-29 22:10:52 -08003431 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003432 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003433}
3434
Jesse Hall606a54e2015-11-19 22:17:28 -08003435cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003436 VkDevice device,
3437 VkImage image,
3438 const VkImageSubresource* pSubresource,
3439 VkSubresourceLayout* pLayout) {
3440 deviceObject := GetDevice(device)
3441 imageObject := GetImage(image)
3442 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003443}
3444
3445
3446// Image view functions
3447
3448@threadSafety("system")
3449cmd VkResult vkCreateImageView(
3450 VkDevice device,
3451 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003452 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003453 VkImageView* pView) {
3454 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
3455 deviceObject := GetDevice(device)
3456
3457 imageObject := GetImage(pCreateInfo.image)
3458 assert(imageObject.device == device)
3459
3460 view := ?
3461 pView[0] = view
3462 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
3463
3464 return ?
3465}
3466
3467@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003468cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003469 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003470 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003471 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003472 deviceObject := GetDevice(device)
3473 imageViewObject := GetImageView(imageView)
3474 assert(imageViewObject.device == device)
3475
3476 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003477}
3478
3479
3480// Shader functions
3481
3482cmd VkResult vkCreateShaderModule(
3483 VkDevice device,
3484 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003485 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003486 VkShaderModule* pShaderModule) {
3487 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
3488 deviceObject := GetDevice(device)
3489
3490 shaderModule := ?
3491 pShaderModule[0] = shaderModule
3492 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
3493
3494 return ?
3495}
3496
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003497cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003498 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003499 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003500 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003501 deviceObject := GetDevice(device)
3502 shaderModuleObject := GetShaderModule(shaderModule)
3503 assert(shaderModuleObject.device == device)
3504
3505 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003506}
3507
Jesse Halld27f6aa2015-08-15 17:58:48 -07003508
3509// Pipeline functions
3510
3511cmd VkResult vkCreatePipelineCache(
3512 VkDevice device,
3513 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003514 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003515 VkPipelineCache* pPipelineCache) {
3516 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
3517 deviceObject := GetDevice(device)
3518
3519 pipelineCache := ?
3520 pPipelineCache[0] = pipelineCache
3521 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
3522
3523 return ?
3524}
3525
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003526cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003527 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003528 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003529 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003530 deviceObject := GetDevice(device)
3531 pipelineCacheObject := GetPipelineCache(pipelineCache)
3532 assert(pipelineCacheObject.device == device)
3533
3534 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003535}
3536
Jesse Halld27f6aa2015-08-15 17:58:48 -07003537cmd VkResult vkGetPipelineCacheData(
3538 VkDevice device,
3539 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003540 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003541 void* pData) {
3542 deviceObject := GetDevice(device)
3543 pipelineCacheObject := GetPipelineCache(pipelineCache)
3544 assert(pipelineCacheObject.device == device)
3545
3546 return ?
3547}
3548
3549cmd VkResult vkMergePipelineCaches(
3550 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003551 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003552 u32 srcCacheCount,
3553 const VkPipelineCache* pSrcCaches) {
3554 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003555 dstCacheObject := GetPipelineCache(dstCache)
3556 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003557
3558 srcCaches := pSrcCaches[0:srcCacheCount]
3559 for i in (0 .. srcCacheCount) {
3560 srcCache := srcCaches[i]
3561 srcCacheObject := GetPipelineCache(srcCache)
3562 assert(srcCacheObject.device == device)
3563 }
3564
3565 return ?
3566}
3567
3568cmd VkResult vkCreateGraphicsPipelines(
3569 VkDevice device,
3570 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003571 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003572 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003573 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003574 VkPipeline* pPipelines) {
3575 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003576 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003577 pipelineCacheObject := GetPipelineCache(pipelineCache)
3578 assert(pipelineCacheObject.device == device)
3579 }
3580
Jesse Hall03b6fe12015-11-24 12:44:21 -08003581 createInfos := pCreateInfos[0:createInfoCount]
3582 pipelines := pPipelines[0:createInfoCount]
3583 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003584 pipeline := ?
3585 pipelines[i] = pipeline
3586 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3587 }
3588
3589 return ?
3590}
3591
3592cmd VkResult vkCreateComputePipelines(
3593 VkDevice device,
3594 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003595 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003596 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003597 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003598 VkPipeline* pPipelines) {
3599 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003600 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003601 pipelineCacheObject := GetPipelineCache(pipelineCache)
3602 assert(pipelineCacheObject.device == device)
3603 }
3604
Jesse Hall03b6fe12015-11-24 12:44:21 -08003605 createInfos := pCreateInfos[0:createInfoCount]
3606 pipelines := pPipelines[0:createInfoCount]
3607 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003608 pipeline := ?
3609 pipelines[i] = pipeline
3610 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3611 }
3612
3613 return ?
3614}
3615
3616@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003617cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003618 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003619 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003620 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003621 deviceObject := GetDevice(device)
3622 pipelineObjects := GetPipeline(pipeline)
3623 assert(pipelineObjects.device == device)
3624
3625 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003626}
3627
3628
3629// Pipeline layout functions
3630
3631@threadSafety("system")
3632cmd VkResult vkCreatePipelineLayout(
3633 VkDevice device,
3634 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003635 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003636 VkPipelineLayout* pPipelineLayout) {
3637 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
3638 deviceObject := GetDevice(device)
3639
3640 pipelineLayout := ?
3641 pPipelineLayout[0] = pipelineLayout
3642 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
3643
3644 return ?
3645}
3646
3647@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003648cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003649 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003650 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003651 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003652 deviceObject := GetDevice(device)
3653 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
3654 assert(pipelineLayoutObjects.device == device)
3655
3656 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003657}
3658
3659
3660// Sampler functions
3661
3662@threadSafety("system")
3663cmd VkResult vkCreateSampler(
3664 VkDevice device,
3665 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003666 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003667 VkSampler* pSampler) {
3668 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
3669 deviceObject := GetDevice(device)
3670
3671 sampler := ?
3672 pSampler[0] = sampler
3673 State.Samplers[sampler] = new!SamplerObject(device: device)
3674
3675 return ?
3676}
3677
3678@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003679cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003680 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003681 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003682 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003683 deviceObject := GetDevice(device)
3684 samplerObject := GetSampler(sampler)
3685 assert(samplerObject.device == device)
3686
3687 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003688}
3689
3690
3691// Descriptor set functions
3692
3693@threadSafety("system")
3694cmd VkResult vkCreateDescriptorSetLayout(
3695 VkDevice device,
3696 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003697 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003698 VkDescriptorSetLayout* pSetLayout) {
3699 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
3700 deviceObject := GetDevice(device)
3701
3702 setLayout := ?
3703 pSetLayout[0] = setLayout
3704 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
3705
3706 return ?
3707}
3708
3709@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003710cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003712 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003713 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003714 deviceObject := GetDevice(device)
3715 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
3716 assert(descriptorSetLayoutObject.device == device)
3717
3718 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003719}
3720
3721@threadSafety("system")
3722cmd VkResult vkCreateDescriptorPool(
3723 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003724 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003725 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003726 VkDescriptorPool* pDescriptorPool) {
3727 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
3728 deviceObject := GetDevice(device)
3729
3730 descriptorPool := ?
3731 pDescriptorPool[0] = descriptorPool
3732 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
3733
3734 return ?
3735}
3736
3737@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003738cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003739 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003740 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003741 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003742 deviceObject := GetDevice(device)
3743 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3744 assert(descriptorPoolObject.device == device)
3745
3746 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003747}
3748
3749@threadSafety("app")
3750cmd VkResult vkResetDescriptorPool(
3751 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08003752 VkDescriptorPool descriptorPool,
3753 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003754 deviceObject := GetDevice(device)
3755 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3756 assert(descriptorPoolObject.device == device)
3757
3758 return ?
3759}
3760
3761@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003762cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003763 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003764 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003765 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003766 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003767 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003768 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003769
Jesse Hall03b6fe12015-11-24 12:44:21 -08003770 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
3771 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003772 setLayout := setLayouts[i]
3773 setLayoutObject := GetDescriptorSetLayout(setLayout)
3774 assert(setLayoutObject.device == device)
3775 }
3776
Jesse Hall03b6fe12015-11-24 12:44:21 -08003777 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
3778 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003779 descriptorSet := ?
3780 descriptorSets[i] = descriptorSet
3781 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
3782 }
3783
3784 return ?
3785}
3786
Jesse Hallf09c6b12015-08-15 19:54:28 -07003787cmd VkResult vkFreeDescriptorSets(
3788 VkDevice device,
3789 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003790 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07003791 const VkDescriptorSet* pDescriptorSets) {
3792 deviceObject := GetDevice(device)
3793 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3794
Jesse Hall03b6fe12015-11-24 12:44:21 -08003795 descriptorSets := pDescriptorSets[0:descriptorSetCount]
3796 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07003797 descriptorSet := descriptorSets[i]
3798 descriptorSetObject := GetDescriptorSet(descriptorSet)
3799 assert(descriptorSetObject.device == device)
3800 State.DescriptorSets[descriptorSet] = null
3801 }
3802
3803 return ?
3804}
3805
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003806cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003807 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08003808 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003809 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08003810 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003811 const VkCopyDescriptorSet* pDescriptorCopies) {
3812 deviceObject := GetDevice(device)
3813
Jesse Hallb00daad2015-11-29 19:46:20 -08003814 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
3815 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003816 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003817 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003818 assert(descriptorWriteObject.device == device)
3819 }
3820
Jesse Hallb00daad2015-11-29 19:46:20 -08003821 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
3822 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003823 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003824 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003825 assert(descriptorCopyObject.device == device)
3826 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003827}
3828
3829
3830// Framebuffer functions
3831
3832@threadSafety("system")
3833cmd VkResult vkCreateFramebuffer(
3834 VkDevice device,
3835 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003836 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003837 VkFramebuffer* pFramebuffer) {
3838 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
3839 deviceObject := GetDevice(device)
3840
3841 framebuffer := ?
3842 pFramebuffer[0] = framebuffer
3843 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
3844
3845 return ?
3846}
3847
3848@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003849cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003850 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003851 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003852 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003853 deviceObject := GetDevice(device)
3854 framebufferObject := GetFramebuffer(framebuffer)
3855 assert(framebufferObject.device == device)
3856
3857 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003858}
3859
3860
3861// Renderpass functions
3862
3863@threadSafety("system")
3864cmd VkResult vkCreateRenderPass(
3865 VkDevice device,
3866 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003867 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003868 VkRenderPass* pRenderPass) {
3869 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
3870 deviceObject := GetDevice(device)
3871
3872 renderpass := ?
3873 pRenderPass[0] = renderpass
3874 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
3875
3876 return ?
3877}
3878
3879@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003880cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003881 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003882 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003883 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003884 deviceObject := GetDevice(device)
3885 renderPassObject := GetRenderPass(renderPass)
3886 assert(renderPassObject.device == device)
3887
3888 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003889}
3890
Jesse Hall606a54e2015-11-19 22:17:28 -08003891cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003892 VkDevice device,
3893 VkRenderPass renderPass,
3894 VkExtent2D* pGranularity) {
3895 deviceObject := GetDevice(device)
3896 renderPassObject := GetRenderPass(renderPass)
3897
3898 granularity := ?
3899 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07003900}
3901
3902// Command pool functions
3903
3904cmd VkResult vkCreateCommandPool(
3905 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003906 const VkCommandPoolCreateInfo* pCreateInfo,
3907 const VkAllocationCallbacks* pAllocator,
3908 VkCommandPool* pCommandPool) {
3909 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003910 deviceObject := GetDevice(device)
3911
Jesse Hall3fbc8562015-11-29 22:10:52 -08003912 commandPool := ?
3913 pCommandPool[0] = commandPool
3914 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003915
3916 return ?
3917}
3918
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003919cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003920 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003921 VkCommandPool commandPool,
3922 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003923 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003924 commandPoolObject := GetCommandPool(commandPool)
3925 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003926
Jesse Hall3fbc8562015-11-29 22:10:52 -08003927 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003928}
3929
3930cmd VkResult vkResetCommandPool(
3931 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003932 VkCommandPool commandPool,
3933 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003934 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003935 commandPoolObject := GetCommandPool(commandPool)
3936 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003937
3938 return ?
3939}
3940
3941// Command buffer functions
3942
Jesse Hall3fbc8562015-11-29 22:10:52 -08003943macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
3944 memoryObject := GetDeviceMemory(memory)
3945 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07003946
Jesse Hall3fbc8562015-11-29 22:10:52 -08003947 commandBufferObject := GetCommandBuffer(commandBuffer)
3948 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07003949}
3950
Jesse Hall3fbc8562015-11-29 22:10:52 -08003951macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
3952 memoryObject := GetDeviceMemory(memory)
3953 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003954
Jesse Hall3fbc8562015-11-29 22:10:52 -08003955 commandBufferObject := GetCommandBuffer(commandBuffer)
3956 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003957}
3958
3959@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003960cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003961 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003962 const VkCommandBufferAllocateInfo* pAllocateInfo,
3963 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003964 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003965
Jesse Hall3dd678a2016-01-08 21:52:01 -08003966 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08003967 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003968 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003969 commandBuffer := ?
3970 commandBuffers[i] = commandBuffer
3971 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08003972 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003973
3974 return ?
3975}
3976
3977@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08003978cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003979 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003980 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003981 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003982 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003983 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003984
Jesse Hall3fbc8562015-11-29 22:10:52 -08003985 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08003986 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003987 commandBufferObject := GetCommandBuffer(commandBuffers[i])
3988 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08003989 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08003990 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08003991 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003992}
3993
3994@threadSafety("app")
3995cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003996 VkCommandBuffer commandBuffer,
3997 const VkCommandBufferBeginInfo* pBeginInfo) {
3998 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
3999 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004000
4001 // TODO: iterate over boundObjects and clear memory bindings
4002
4003 return ?
4004}
4005
4006@threadSafety("app")
4007cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004008 VkCommandBuffer commandBuffer) {
4009 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004010
4011 return ?
4012}
4013
4014@threadSafety("app")
4015cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004016 VkCommandBuffer commandBuffer,
4017 VkCommandBufferResetFlags flags) {
4018 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004019
4020 // TODO: iterate over boundObjects and clear memory bindings
4021
4022 return ?
4023}
4024
4025
4026// Command buffer building functions
4027
4028@threadSafety("app")
4029cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004030 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004031 VkPipelineBindPoint pipelineBindPoint,
4032 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004033 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004034 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004035 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004036
Jesse Halld8bade02015-11-24 10:24:18 -08004037 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004038 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4039 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4040 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004041 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004042}
4043
4044@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004045cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004046 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004047 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004048 u32 viewportCount,
4049 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004050 commandBufferObject := GetCommandBuffer(commandBuffer)
4051 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004052}
4053
4054@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004055cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004056 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004057 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004058 u32 scissorCount,
4059 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004060 commandBufferObject := GetCommandBuffer(commandBuffer)
4061 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004062}
4063
4064@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004065cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004066 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004067 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004068 commandBufferObject := GetCommandBuffer(commandBuffer)
4069 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004070}
4071
4072@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004073cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004074 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004075 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004076 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004077 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004078 commandBufferObject := GetCommandBuffer(commandBuffer)
4079 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004080}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004081
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004082@threadSafety("app")
4083cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004084 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004085 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4086 // an annotation as a quick hack to pass this to the template without
4087 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004088 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004089 commandBufferObject := GetCommandBuffer(commandBuffer)
4090 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004091}
4092
4093@threadSafety("app")
4094cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004095 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004096 f32 minDepthBounds,
4097 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004098 commandBufferObject := GetCommandBuffer(commandBuffer)
4099 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004100}
4101
4102@threadSafety("app")
4103cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004104 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004105 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004106 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004107 commandBufferObject := GetCommandBuffer(commandBuffer)
4108 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004109}
4110
4111@threadSafety("app")
4112cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004113 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004114 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004115 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004116 commandBufferObject := GetCommandBuffer(commandBuffer)
4117 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004118}
4119
4120@threadSafety("app")
4121cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004122 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004123 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004124 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004125 commandBufferObject := GetCommandBuffer(commandBuffer)
4126 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004127}
4128
4129@threadSafety("app")
4130cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004131 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004132 VkPipelineBindPoint pipelineBindPoint,
4133 VkPipelineLayout layout,
4134 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004135 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004136 const VkDescriptorSet* pDescriptorSets,
4137 u32 dynamicOffsetCount,
4138 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004139 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004140
Jesse Hall03b6fe12015-11-24 12:44:21 -08004141 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4142 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004143 descriptorSet := descriptorSets[i]
4144 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004145 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004146 }
4147
4148 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4149 for i in (0 .. dynamicOffsetCount) {
4150 dynamicOffset := dynamicOffsets[i]
4151 }
4152
Jesse Halld8bade02015-11-24 10:24:18 -08004153 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004154 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4155 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4156 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004157 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004158}
4159
4160@threadSafety("app")
4161cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004162 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004163 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004164 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004165 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004166 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004167 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004168 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004169
Jesse Hall3fbc8562015-11-29 22:10:52 -08004170 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004171
Jesse Hall3fbc8562015-11-29 22:10:52 -08004172 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004173}
4174
4175@threadSafety("app")
4176cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004177 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004178 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004179 u32 bindingCount,
4180 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004181 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004182 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004183
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004184 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004185 buffers := pBuffers[0:bindingCount]
4186 offsets := pOffsets[0:bindingCount]
4187 for i in (0 .. bindingCount) {
4188 buffer := buffers[i]
4189 offset := offsets[i]
4190 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004191 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004192
Jesse Hall3fbc8562015-11-29 22:10:52 -08004193 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004194 }
4195
Jesse Hall3fbc8562015-11-29 22:10:52 -08004196 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004197}
4198
4199@threadSafety("app")
4200cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004201 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004202 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004203 u32 instanceCount,
4204 u32 firstVertex,
4205 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004206 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004207
Jesse Hall3fbc8562015-11-29 22:10:52 -08004208 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004209}
4210
4211@threadSafety("app")
4212cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004213 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004214 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004215 u32 instanceCount,
4216 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004217 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004218 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004219 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004220
Jesse Hall3fbc8562015-11-29 22:10:52 -08004221 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004222}
4223
4224@threadSafety("app")
4225cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004226 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004227 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004228 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004229 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004230 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004231 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004232 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004233 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004234
Jesse Hall3fbc8562015-11-29 22:10:52 -08004235 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004236
Jesse Hall3fbc8562015-11-29 22:10:52 -08004237 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004238}
4239
4240@threadSafety("app")
4241cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004242 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004243 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004244 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004245 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004246 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004247 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004248 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004249 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004250
Jesse Hall3fbc8562015-11-29 22:10:52 -08004251 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004252
Jesse Hall3fbc8562015-11-29 22:10:52 -08004253 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004254}
4255
4256@threadSafety("app")
4257cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004258 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004259 u32 x,
4260 u32 y,
4261 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004262 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004263
Jesse Hall3fbc8562015-11-29 22:10:52 -08004264 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004265}
4266
4267@threadSafety("app")
4268cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004269 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004270 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004271 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004272 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004273 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004274 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004275
Jesse Hall3fbc8562015-11-29 22:10:52 -08004276 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004277
Jesse Hall3fbc8562015-11-29 22:10:52 -08004278 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004279}
4280
4281@threadSafety("app")
4282cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004283 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004284 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004285 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004286 u32 regionCount,
4287 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004288 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004289 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004290 dstBufferObject := GetBuffer(dstBuffer)
4291 assert(commandBufferObject.device == srcBufferObject.device)
4292 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004293
4294 regions := pRegions[0:regionCount]
4295 for i in (0 .. regionCount) {
4296 region := regions[i]
4297 }
4298
Jesse Hall3fbc8562015-11-29 22:10:52 -08004299 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4300 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004301
Jesse Hall65ab5522015-11-30 00:07:16 -08004302 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004303}
4304
4305@threadSafety("app")
4306cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004307 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004308 VkImage srcImage,
4309 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004310 VkImage dstImage,
4311 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004312 u32 regionCount,
4313 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004314 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004315 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004316 dstImageObject := GetImage(dstImage)
4317 assert(commandBufferObject.device == srcImageObject.device)
4318 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004319
4320 regions := pRegions[0:regionCount]
4321 for i in (0 .. regionCount) {
4322 region := regions[i]
4323 }
4324
Jesse Hall3fbc8562015-11-29 22:10:52 -08004325 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4326 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004327
Jesse Hall65ab5522015-11-30 00:07:16 -08004328 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004329}
4330
4331@threadSafety("app")
4332cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004333 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004334 VkImage srcImage,
4335 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004336 VkImage dstImage,
4337 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004338 u32 regionCount,
4339 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004340 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004341 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004342 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004343 dstImageObject := GetImage(dstImage)
4344 assert(commandBufferObject.device == srcImageObject.device)
4345 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004346
4347 regions := pRegions[0:regionCount]
4348 for i in (0 .. regionCount) {
4349 region := regions[i]
4350 }
4351
Jesse Hall3fbc8562015-11-29 22:10:52 -08004352 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4353 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004354
Jesse Hall3fbc8562015-11-29 22:10:52 -08004355 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004356}
4357
4358@threadSafety("app")
4359cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004360 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004361 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004362 VkImage dstImage,
4363 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004364 u32 regionCount,
4365 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004366 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004367 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004368 dstImageObject := GetImage(dstImage)
4369 assert(commandBufferObject.device == srcBufferObject.device)
4370 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004371
4372 regions := pRegions[0:regionCount]
4373 for i in (0 .. regionCount) {
4374 region := regions[i]
4375 }
4376
Jesse Hall3fbc8562015-11-29 22:10:52 -08004377 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4378 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004379
Jesse Hall65ab5522015-11-30 00:07:16 -08004380 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004381}
4382
4383@threadSafety("app")
4384cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004385 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004386 VkImage srcImage,
4387 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004388 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004389 u32 regionCount,
4390 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004391 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004392 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004393 dstBufferObject := GetBuffer(dstBuffer)
4394 assert(commandBufferObject.device == srcImageObject.device)
4395 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004396
4397 regions := pRegions[0:regionCount]
4398 for i in (0 .. regionCount) {
4399 region := regions[i]
4400 }
4401
Jesse Hall3fbc8562015-11-29 22:10:52 -08004402 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4403 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004404
Jesse Hall65ab5522015-11-30 00:07:16 -08004405 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004406}
4407
4408@threadSafety("app")
4409cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004410 VkCommandBuffer commandBuffer,
4411 VkBuffer dstBuffer,
4412 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004413 VkDeviceSize dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004414 const u32* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004415 commandBufferObject := GetCommandBuffer(commandBuffer)
4416 dstBufferObject := GetBuffer(dstBuffer)
4417 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004418
4419 data := pData[0:dataSize]
4420
Jesse Hall3fbc8562015-11-29 22:10:52 -08004421 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004422
Jesse Hall65ab5522015-11-30 00:07:16 -08004423 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004424}
4425
4426@threadSafety("app")
4427cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004428 VkCommandBuffer commandBuffer,
4429 VkBuffer dstBuffer,
4430 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004431 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004432 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004433 commandBufferObject := GetCommandBuffer(commandBuffer)
4434 dstBufferObject := GetBuffer(dstBuffer)
4435 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004436
Jesse Hall65ab5522015-11-30 00:07:16 -08004437 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004438}
4439
4440@threadSafety("app")
4441cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004442 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004443 VkImage image,
4444 VkImageLayout imageLayout,
4445 const VkClearColorValue* pColor,
4446 u32 rangeCount,
4447 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004448 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004449 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004450 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004451
4452 ranges := pRanges[0:rangeCount]
4453 for i in (0 .. rangeCount) {
4454 range := ranges[i]
4455 }
4456
Jesse Hall3fbc8562015-11-29 22:10:52 -08004457 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004458
Jesse Hall3fbc8562015-11-29 22:10:52 -08004459 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004460}
4461
4462@threadSafety("app")
4463cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004464 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004465 VkImage image,
4466 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004467 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004468 u32 rangeCount,
4469 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004470 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004471 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004472 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004473
4474 ranges := pRanges[0:rangeCount]
4475 for i in (0 .. rangeCount) {
4476 range := ranges[i]
4477 }
4478
Jesse Hall3fbc8562015-11-29 22:10:52 -08004479 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004480
Jesse Hall3fbc8562015-11-29 22:10:52 -08004481 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004482}
4483
4484@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08004485cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004486 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08004487 u32 attachmentCount,
4488 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004489 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08004490 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004491 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004492
4493 rects := pRects[0:rectCount]
4494 for i in (0 .. rectCount) {
4495 rect := rects[i]
4496 }
4497
Jesse Hall3fbc8562015-11-29 22:10:52 -08004498 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004499}
4500
4501@threadSafety("app")
4502cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004503 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004504 VkImage srcImage,
4505 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004506 VkImage dstImage,
4507 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004508 u32 regionCount,
4509 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004510 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004511 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004512 dstImageObject := GetImage(dstImage)
4513 assert(commandBufferObject.device == srcImageObject.device)
4514 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004515
4516 regions := pRegions[0:regionCount]
4517 for i in (0 .. regionCount) {
4518 region := regions[i]
4519 }
4520
Jesse Hall3fbc8562015-11-29 22:10:52 -08004521 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4522 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004523
Jesse Hall3fbc8562015-11-29 22:10:52 -08004524 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004525}
4526
4527@threadSafety("app")
4528cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004529 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004530 VkEvent event,
4531 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004532 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004533 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004534 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004535}
4536
4537@threadSafety("app")
4538cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004539 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004540 VkEvent event,
4541 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004542 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004543 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004544 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004545}
4546
4547@threadSafety("app")
4548cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004549 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004550 u32 eventCount,
4551 const VkEvent* pEvents,
4552 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004553 VkPipelineStageFlags dstStageMask,
4554 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004555 const VkMemoryBarrier* pMemoryBarriers,
4556 u32 bufferMemoryBarrierCount,
4557 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4558 u32 imageMemoryBarrierCount,
4559 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004560 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004561
4562 events := pEvents[0:eventCount]
4563 for i in (0 .. eventCount) {
4564 event := events[i]
4565 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004566 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004567 }
4568
Jesse Hall3dd678a2016-01-08 21:52:01 -08004569 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004570 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004571 memoryBarrier := memoryBarriers[i]
4572 }
4573 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4574 for i in (0 .. bufferMemoryBarrierCount) {
4575 bufferMemoryBarrier := bufferMemoryBarriers[i]
4576 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4577 assert(bufferObject.device == commandBufferObject.device)
4578 }
4579 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4580 for i in (0 .. imageMemoryBarrierCount) {
4581 imageMemoryBarrier := imageMemoryBarriers[i]
4582 imageObject := GetImage(imageMemoryBarrier.image)
4583 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004584 }
4585}
4586
4587@threadSafety("app")
4588cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004589 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004590 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004591 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08004592 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004593 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004594 const VkMemoryBarrier* pMemoryBarriers,
4595 u32 bufferMemoryBarrierCount,
4596 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4597 u32 imageMemoryBarrierCount,
4598 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004599 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004600
Jesse Hall3dd678a2016-01-08 21:52:01 -08004601 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004602 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004603 memoryBarrier := memoryBarriers[i]
4604 }
4605 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4606 for i in (0 .. bufferMemoryBarrierCount) {
4607 bufferMemoryBarrier := bufferMemoryBarriers[i]
4608 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4609 assert(bufferObject.device == commandBufferObject.device)
4610 }
4611 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4612 for i in (0 .. imageMemoryBarrierCount) {
4613 imageMemoryBarrier := imageMemoryBarriers[i]
4614 imageObject := GetImage(imageMemoryBarrier.image)
4615 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004616 }
4617}
4618
4619@threadSafety("app")
4620cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004621 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004622 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004623 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004624 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004625 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004626 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004627 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004628}
4629
4630@threadSafety("app")
4631cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004632 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004633 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004634 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004635 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004636 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004637 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004638}
4639
4640@threadSafety("app")
4641cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004642 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004643 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004644 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004645 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004646 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004647 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004648 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004649}
4650
4651@threadSafety("app")
4652cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004653 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08004654 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004655 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004656 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004657 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004658 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004659 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004660}
4661
4662@threadSafety("app")
4663cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004664 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004665 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004666 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004667 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004668 VkBuffer dstBuffer,
4669 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004670 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004671 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004672 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004673 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004674 dstBufferObject := GetBuffer(dstBuffer)
4675 assert(commandBufferObject.device == queryPoolObject.device)
4676 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004677}
4678
4679cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004680 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004681 VkPipelineLayout layout,
4682 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004683 u32 offset,
4684 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004685 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004686 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004687 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004688 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004689}
4690
4691@threadSafety("app")
4692cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004693 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004694 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08004695 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004696 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004697 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
4698 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004699 assert(commandBufferObject.device == renderPassObject.device)
4700 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004701
Jesse Hall3fbc8562015-11-29 22:10:52 -08004702 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004703}
4704
4705cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004706 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08004707 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004708 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004709}
4710
4711@threadSafety("app")
4712cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004713 VkCommandBuffer commandBuffer) {
4714 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004715
Jesse Hall3fbc8562015-11-29 22:10:52 -08004716 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004717}
4718
4719cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004720 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004721 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004722 const VkCommandBuffer* pCommandBuffers) {
4723 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004724
Jesse Hall3dd678a2016-01-08 21:52:01 -08004725 commandBuffers := pCommandBuffers[0:commandBufferCount]
4726 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004727 secondaryCommandBuffer := commandBuffers[i]
4728 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
4729 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004730 }
4731}
4732
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004733@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004734cmd void vkDestroySurfaceKHR(
4735 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08004736 VkSurfaceKHR surface,
4737 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004738 instanceObject := GetInstance(instance)
4739 surfaceObject := GetSurface(surface)
4740 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08004741
Jesse Hall1356b0d2015-11-23 17:24:58 -08004742 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08004743}
4744
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004745@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004746cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004747 VkPhysicalDevice physicalDevice,
4748 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004749 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08004750 VkBool32* pSupported) {
4751 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004752
4753 return ?
4754}
4755
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004756@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004757cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
4758 VkPhysicalDevice physicalDevice,
4759 VkSurfaceKHR surface,
4760 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
4761 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4762
4763 surfaceCapabilities := ?
4764 pSurfaceCapabilities[0] = surfaceCapabilities
4765
4766 return ?
4767}
4768
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004769@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004770cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
4771 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004772 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004773 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004774 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004775 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004776
4777 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004778 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004779 surfaceFormats := pSurfaceFormats[0:count]
4780
4781 for i in (0 .. count) {
4782 surfaceFormat := ?
4783 surfaceFormats[i] = surfaceFormat
4784 }
4785
4786 return ?
4787}
4788
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004789@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004790cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
4791 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004792 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004793 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004794 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004795 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004796
4797 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004798 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004799 presentModes := pPresentModes[0:count]
4800
4801 for i in (0 .. count) {
4802 presentMode := ?
4803 presentModes[i] = presentMode
4804 }
4805
4806 return ?
4807}
4808
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004809@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004810cmd VkResult vkCreateSwapchainKHR(
4811 VkDevice device,
4812 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004813 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08004814 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004815 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08004816 deviceObject := GetDevice(device)
4817
4818 swapchain := ?
4819 pSwapchain[0] = swapchain
4820 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
4821
4822 return ?
4823}
4824
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004825@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004826cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08004827 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08004828 VkSwapchainKHR swapchain,
4829 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08004830 deviceObject := GetDevice(device)
4831 swapchainObject := GetSwapchain(swapchain)
4832 assert(swapchainObject.device == device)
4833
4834 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08004835}
4836
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004837@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004838cmd VkResult vkGetSwapchainImagesKHR(
4839 VkDevice device,
4840 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004841 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08004842 VkImage* pSwapchainImages) {
4843 deviceObject := GetDevice(device)
4844
4845 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004846 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004847 swapchainImages := pSwapchainImages[0:count]
4848
4849 for i in (0 .. count) {
4850 swapchainImage := ?
4851 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08004852 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08004853 }
4854
4855 return ?
4856}
4857
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004858@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004859cmd VkResult vkAcquireNextImageKHR(
4860 VkDevice device,
4861 VkSwapchainKHR swapchain,
4862 u64 timeout,
4863 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004864 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08004865 u32* pImageIndex) {
4866 deviceObject := GetDevice(device)
4867 swapchainObject := GetSwapchain(swapchain)
4868
4869 imageIndex := ?
4870 pImageIndex[0] = imageIndex
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 vkQueuePresentKHR(
4877 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004878 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08004879 queueObject := GetQueue(queue)
4880
4881 presentInfo := ?
4882 pPresentInfo[0] = presentInfo
4883
4884 return ?
4885}
4886
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004887@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004888cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
4889 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004890 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004891 VkDisplayPropertiesKHR* pProperties) {
4892 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4893 return ?
4894}
4895
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004896@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004897cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
4898 VkPhysicalDevice physicalDevice,
4899 u32* pPropertyCount,
4900 VkDisplayPlanePropertiesKHR* pProperties) {
4901 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4902 return ?
4903}
4904
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004905@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004906cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
4907 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004908 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004909 u32* pDisplayCount,
4910 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08004911 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4912 return ?
4913}
4914
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004915@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004916cmd VkResult vkGetDisplayModePropertiesKHR(
4917 VkPhysicalDevice physicalDevice,
4918 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004919 u32* pPropertyCount,
4920 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004921 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4922 return ?
4923}
4924
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004925@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004926cmd VkResult vkCreateDisplayModeKHR(
4927 VkPhysicalDevice physicalDevice,
4928 VkDisplayKHR display,
4929 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004930 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004931 VkDisplayModeKHR* pMode) {
4932 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4933 return ?
4934}
4935
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004936@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004937cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004938 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08004939 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004940 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08004941 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004942 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4943 return ?
4944}
4945
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004946@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004947cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
4948 VkInstance instance,
4949 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004950 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08004951 VkSurfaceKHR* pSurface) {
4952 return ?
4953}
4954
Jesse Hall9ba8bc82015-11-30 16:22:16 -08004955@extension("VK_KHR_display_swapchain")
4956cmd VkResult vkCreateSharedSwapchainsKHR(
4957 VkDevice device,
4958 u32 swapchainCount,
4959 const VkSwapchainCreateInfoKHR* pCreateInfos,
4960 const VkAllocationCallbacks* pAllocator,
4961 VkSwapchainKHR* pSwapchains) {
4962 return ?
4963}
4964
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004965@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004966cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004967 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004968 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004969 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004970 VkSurfaceKHR* pSurface) {
4971 instanceObject := GetInstance(instance)
4972 return ?
4973}
4974
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004975@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004976cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
4977 VkPhysicalDevice physicalDevice,
4978 u32 queueFamilyIndex,
4979 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08004980 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08004981 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4982 return ?
4983}
4984
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004985@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004986cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004987 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004988 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004989 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004990 VkSurfaceKHR* pSurface) {
4991 instanceObject := GetInstance(instance)
4992 return ?
4993}
4994
Jesse Hall523db342015-11-30 21:12:55 -08004995@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004996cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
4997 VkPhysicalDevice physicalDevice,
4998 u32 queueFamilyIndex,
4999 platform.xcb_connection_t* connection,
5000 platform.xcb_visualid_t visual_id) {
5001 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5002 return ?
5003}
5004
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005005@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005006cmd VkResult vkCreateWaylandSurfaceKHR(
5007 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005008 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005009 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005010 VkSurfaceKHR* pSurface) {
5011 instanceObject := GetInstance(instance)
5012 return ?
5013}
5014
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005015@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005016cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5017 VkPhysicalDevice physicalDevice,
5018 u32 queueFamilyIndex,
5019 platform.wl_display* display) {
5020 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5021 return ?
5022}
5023
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005024@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005025cmd VkResult vkCreateMirSurfaceKHR(
5026 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005027 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005028 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005029 VkSurfaceKHR* pSurface) {
5030 instanceObject := GetInstance(instance)
5031 return ?
5032}
5033
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005034@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005035cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5036 VkPhysicalDevice physicalDevice,
5037 u32 queueFamilyIndex,
5038 platform.MirConnection* connection) {
5039 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5040 return ?
5041}
5042
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005043@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005044cmd VkResult vkCreateAndroidSurfaceKHR(
5045 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005046 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005047 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005048 VkSurfaceKHR* pSurface) {
5049 instanceObject := GetInstance(instance)
5050 return ?
5051}
5052
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005053@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005054cmd VkResult vkCreateWin32SurfaceKHR(
5055 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005056 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005057 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005058 VkSurfaceKHR* pSurface) {
5059 instanceObject := GetInstance(instance)
5060 return ?
5061}
5062
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005063@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005064cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5065 VkPhysicalDevice physicalDevice,
5066 u32 queueFamilyIndex) {
5067 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5068 return ?
5069}
5070
Jesse Halld27f6aa2015-08-15 17:58:48 -07005071
5072////////////////
5073// Validation //
5074////////////////
5075
5076extern void validate(string layerName, bool condition, string message)
5077
5078
5079/////////////////////////////
5080// Internal State Tracking //
5081/////////////////////////////
5082
5083StateObject State
5084
5085@internal class StateObject {
5086 // Dispatchable objects.
5087 map!(VkInstance, ref!InstanceObject) Instances
5088 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5089 map!(VkDevice, ref!DeviceObject) Devices
5090 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005091 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005092
5093 // Non-dispatchable objects.
5094 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5095 map!(VkBuffer, ref!BufferObject) Buffers
5096 map!(VkBufferView, ref!BufferViewObject) BufferViews
5097 map!(VkImage, ref!ImageObject) Images
5098 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005099 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005100 map!(VkPipeline, ref!PipelineObject) Pipelines
5101 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5102 map!(VkSampler, ref!SamplerObject) Samplers
5103 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5104 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5105 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005106 map!(VkFence, ref!FenceObject) Fences
5107 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5108 map!(VkEvent, ref!EventObject) Events
5109 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5110 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5111 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5112 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005113 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005114 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005115 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005116}
5117
5118@internal class InstanceObject {
5119}
5120
5121@internal class PhysicalDeviceObject {
5122 VkInstance instance
5123}
5124
5125@internal class DeviceObject {
5126 VkPhysicalDevice physicalDevice
5127}
5128
5129@internal class QueueObject {
5130 VkDevice device
5131 VkQueueFlags flags
5132}
5133
Jesse Hall3fbc8562015-11-29 22:10:52 -08005134@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005135 VkDevice device
5136 map!(u64, VkDeviceMemory) boundObjects
5137 VkQueueFlags queueFlags
5138}
5139
5140@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005141 VkDevice device
5142 VkDeviceSize allocationSize
5143 map!(u64, VkDeviceSize) boundObjects
5144 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005145}
5146
5147@internal class BufferObject {
5148 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005149 VkDeviceMemory memory
5150 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005151}
5152
5153@internal class BufferViewObject {
5154 VkDevice device
5155 VkBuffer buffer
5156}
5157
5158@internal class ImageObject {
5159 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005160 VkDeviceMemory memory
5161 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005162}
5163
5164@internal class ImageViewObject {
5165 VkDevice device
5166 VkImage image
5167}
5168
Jesse Halld27f6aa2015-08-15 17:58:48 -07005169@internal class ShaderObject {
5170 VkDevice device
5171}
5172
5173@internal class ShaderModuleObject {
5174 VkDevice device
5175}
5176
5177@internal class PipelineObject {
5178 VkDevice device
5179}
5180
5181@internal class PipelineLayoutObject {
5182 VkDevice device
5183}
5184
5185@internal class SamplerObject {
5186 VkDevice device
5187}
5188
5189@internal class DescriptorSetObject {
5190 VkDevice device
5191}
5192
5193@internal class DescriptorSetLayoutObject {
5194 VkDevice device
5195}
5196
5197@internal class DescriptorPoolObject {
5198 VkDevice device
5199}
5200
Jesse Halld27f6aa2015-08-15 17:58:48 -07005201@internal class FenceObject {
5202 VkDevice device
5203 bool signaled
5204}
5205
5206@internal class SemaphoreObject {
5207 VkDevice device
5208}
5209
5210@internal class EventObject {
5211 VkDevice device
5212}
5213
5214@internal class QueryPoolObject {
5215 VkDevice device
5216}
5217
5218@internal class FramebufferObject {
5219 VkDevice device
5220}
5221
5222@internal class RenderPassObject {
5223 VkDevice device
5224}
5225
5226@internal class PipelineCacheObject {
5227 VkDevice device
5228}
5229
Jesse Hall3fbc8562015-11-29 22:10:52 -08005230@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005231 VkDevice device
5232}
5233
Jesse Hall1356b0d2015-11-23 17:24:58 -08005234@internal class SurfaceObject {
5235 VkInstance instance
5236}
5237
Michael Lentine88594d72015-11-12 12:49:45 -08005238@internal class SwapchainObject {
5239 VkDevice device
5240}
5241
Jesse Halld27f6aa2015-08-15 17:58:48 -07005242macro ref!InstanceObject GetInstance(VkInstance instance) {
5243 assert(instance in State.Instances)
5244 return State.Instances[instance]
5245}
5246
5247macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
5248 assert(physicalDevice in State.PhysicalDevices)
5249 return State.PhysicalDevices[physicalDevice]
5250}
5251
5252macro ref!DeviceObject GetDevice(VkDevice device) {
5253 assert(device in State.Devices)
5254 return State.Devices[device]
5255}
5256
5257macro ref!QueueObject GetQueue(VkQueue queue) {
5258 assert(queue in State.Queues)
5259 return State.Queues[queue]
5260}
5261
Jesse Hall3fbc8562015-11-29 22:10:52 -08005262macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
5263 assert(commandBuffer in State.CommandBuffers)
5264 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005265}
5266
Jesse Hall3fbc8562015-11-29 22:10:52 -08005267macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
5268 assert(memory in State.DeviceMemories)
5269 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005270}
5271
5272macro ref!BufferObject GetBuffer(VkBuffer buffer) {
5273 assert(buffer in State.Buffers)
5274 return State.Buffers[buffer]
5275}
5276
5277macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
5278 assert(bufferView in State.BufferViews)
5279 return State.BufferViews[bufferView]
5280}
5281
5282macro ref!ImageObject GetImage(VkImage image) {
5283 assert(image in State.Images)
5284 return State.Images[image]
5285}
5286
5287macro ref!ImageViewObject GetImageView(VkImageView imageView) {
5288 assert(imageView in State.ImageViews)
5289 return State.ImageViews[imageView]
5290}
5291
Jesse Halld27f6aa2015-08-15 17:58:48 -07005292macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
5293 assert(shaderModule in State.ShaderModules)
5294 return State.ShaderModules[shaderModule]
5295}
5296
5297macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
5298 assert(pipeline in State.Pipelines)
5299 return State.Pipelines[pipeline]
5300}
5301
5302macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
5303 assert(pipelineLayout in State.PipelineLayouts)
5304 return State.PipelineLayouts[pipelineLayout]
5305}
5306
5307macro ref!SamplerObject GetSampler(VkSampler sampler) {
5308 assert(sampler in State.Samplers)
5309 return State.Samplers[sampler]
5310}
5311
5312macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
5313 assert(descriptorSet in State.DescriptorSets)
5314 return State.DescriptorSets[descriptorSet]
5315}
5316
5317macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
5318 assert(descriptorSetLayout in State.DescriptorSetLayouts)
5319 return State.DescriptorSetLayouts[descriptorSetLayout]
5320}
5321
5322macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
5323 assert(descriptorPool in State.DescriptorPools)
5324 return State.DescriptorPools[descriptorPool]
5325}
5326
Jesse Halld27f6aa2015-08-15 17:58:48 -07005327macro ref!FenceObject GetFence(VkFence fence) {
5328 assert(fence in State.Fences)
5329 return State.Fences[fence]
5330}
5331
5332macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
5333 assert(semaphore in State.Semaphores)
5334 return State.Semaphores[semaphore]
5335}
5336
5337macro ref!EventObject GetEvent(VkEvent event) {
5338 assert(event in State.Events)
5339 return State.Events[event]
5340}
5341
5342macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
5343 assert(queryPool in State.QueryPools)
5344 return State.QueryPools[queryPool]
5345}
5346
5347macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
5348 assert(framebuffer in State.Framebuffers)
5349 return State.Framebuffers[framebuffer]
5350}
5351
5352macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
5353 assert(renderPass in State.RenderPasses)
5354 return State.RenderPasses[renderPass]
5355}
5356
5357macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
5358 assert(pipelineCache in State.PipelineCaches)
5359 return State.PipelineCaches[pipelineCache]
5360}
5361
Jesse Hall3fbc8562015-11-29 22:10:52 -08005362macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
5363 assert(commandPool in State.CommandPools)
5364 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07005365}
Michael Lentine88594d72015-11-12 12:49:45 -08005366
Jesse Hall1356b0d2015-11-23 17:24:58 -08005367macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
5368 assert(surface in State.Surfaces)
5369 return State.Surfaces[surface]
5370}
5371
Michael Lentine88594d72015-11-12 12:49:45 -08005372macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
5373 assert(swapchain in State.Swapchains)
5374 return State.Swapchains[swapchain]
5375}
Jesse Halld8bade02015-11-24 10:24:18 -08005376
5377macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
5378 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
5379}