blob: ae690a323b178c86b6adab2209b8497faad62ea5 [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 Halle2948d82016-02-25 04:19:32 -080031define VERSION_PATCH 3
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall33faaad2016-01-24 21:00:49 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall543a7ff2016-01-08 16:38:30 -080051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 67
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall33faaad2016-01-24 21:00:49 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Chia-I Wub262ddc2016-03-22 07:38:20 +080078@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 5
79@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
80
Jesse Halle2948d82016-02-25 04:19:32 -080081@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 1
Jesse Hall715b86a2016-01-16 16:34:29 -080082@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
83
Jesse Halld27f6aa2015-08-15 17:58:48 -070084
85/////////////
86// Types //
87/////////////
88
Jesse Hall5ae3abb2015-10-08 14:00:22 -070089type u32 VkBool32
90type u32 VkFlags
91type u64 VkDeviceSize
92type u32 VkSampleMask
93
Jesse Halld27f6aa2015-08-15 17:58:48 -070094/// Dispatchable handle types.
95@dispatchHandle type u64 VkInstance
96@dispatchHandle type u64 VkPhysicalDevice
97@dispatchHandle type u64 VkDevice
98@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -080099@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700100
101/// Non dispatchable handle types.
102@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800103@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700104@nonDispatchHandle type u64 VkBuffer
105@nonDispatchHandle type u64 VkBufferView
106@nonDispatchHandle type u64 VkImage
107@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700108@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700109@nonDispatchHandle type u64 VkPipeline
110@nonDispatchHandle type u64 VkPipelineLayout
111@nonDispatchHandle type u64 VkSampler
112@nonDispatchHandle type u64 VkDescriptorSet
113@nonDispatchHandle type u64 VkDescriptorSetLayout
114@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700115@nonDispatchHandle type u64 VkFence
116@nonDispatchHandle type u64 VkSemaphore
117@nonDispatchHandle type u64 VkEvent
118@nonDispatchHandle type u64 VkQueryPool
119@nonDispatchHandle type u64 VkFramebuffer
120@nonDispatchHandle type u64 VkRenderPass
121@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800122
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800123@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800124
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800125@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800126
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800127@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
128@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700129
Jesse Hall715b86a2016-01-16 16:34:29 -0800130@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
131
Jesse Halld27f6aa2015-08-15 17:58:48 -0700132
133/////////////
134// Enums //
135/////////////
136
137enum VkImageLayout {
138 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
139 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
140 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
141 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
142 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
143 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 -0800144 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
145 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 -0700146 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800147
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800148 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800149 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700150}
151
152enum VkAttachmentLoadOp {
153 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
154 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
155 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
156}
157
158enum VkAttachmentStoreOp {
159 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
160 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
161}
162
163enum VkImageType {
164 VK_IMAGE_TYPE_1D = 0x00000000,
165 VK_IMAGE_TYPE_2D = 0x00000001,
166 VK_IMAGE_TYPE_3D = 0x00000002,
167}
168
169enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800170 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
171 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700172}
173
174enum VkImageViewType {
175 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
176 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
177 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
178 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
179 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
180 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
181 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
182}
183
Jesse Hall3fbc8562015-11-29 22:10:52 -0800184enum VkCommandBufferLevel {
185 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
186 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700187}
188
Jesse Hall65ab5522015-11-30 00:07:16 -0800189enum VkComponentSwizzle {
190 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
191 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
192 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
193 VK_COMPONENT_SWIZZLE_R = 0x00000003,
194 VK_COMPONENT_SWIZZLE_G = 0x00000004,
195 VK_COMPONENT_SWIZZLE_B = 0x00000005,
196 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700197}
198
199enum VkDescriptorType {
200 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
201 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
202 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
203 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
204 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
205 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
206 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
207 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
208 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
209 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
210 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
211}
212
Jesse Halld27f6aa2015-08-15 17:58:48 -0700213enum VkQueryType {
214 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
215 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800216 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700217}
218
Jesse Halld27f6aa2015-08-15 17:58:48 -0700219enum VkBorderColor {
220 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
221 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
222 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
223 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
224 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
225 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
226}
227
228enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800229 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
230 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700231}
232
233enum VkPrimitiveTopology {
234 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
235 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
236 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
237 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
238 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
239 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800240 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
241 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
242 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
243 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800244 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700245}
246
247enum VkSharingMode {
248 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
249 VK_SHARING_MODE_CONCURRENT = 0x00000001,
250}
251
252enum VkIndexType {
253 VK_INDEX_TYPE_UINT16 = 0x00000000,
254 VK_INDEX_TYPE_UINT32 = 0x00000001,
255}
256
Jesse Hall23ff73f2015-11-29 14:36:39 -0800257enum VkFilter {
258 VK_FILTER_NEAREST = 0x00000000,
259 VK_FILTER_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700260}
261
Jesse Hall23ff73f2015-11-29 14:36:39 -0800262enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800263 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
264 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700265}
266
Jesse Hall23ff73f2015-11-29 14:36:39 -0800267enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800268 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
269 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
270 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
271 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
272 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700273}
274
275enum VkCompareOp {
276 VK_COMPARE_OP_NEVER = 0x00000000,
277 VK_COMPARE_OP_LESS = 0x00000001,
278 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800279 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700280 VK_COMPARE_OP_GREATER = 0x00000004,
281 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800282 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700283 VK_COMPARE_OP_ALWAYS = 0x00000007,
284}
285
Jesse Hall65ab5522015-11-30 00:07:16 -0800286enum VkPolygonMode {
287 VK_POLYGON_MODE_FILL = 0x00000000,
288 VK_POLYGON_MODE_LINE = 0x00000001,
289 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700290}
291
292enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800293 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
294 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700295}
296
Jesse Hall65ab5522015-11-30 00:07:16 -0800297enum VkBlendFactor {
298 VK_BLEND_FACTOR_ZERO = 0x00000000,
299 VK_BLEND_FACTOR_ONE = 0x00000001,
300 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
301 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
302 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
303 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
304 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
305 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
306 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
307 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
308 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
309 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
310 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
311 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
312 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
313 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
314 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
315 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
316 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700317}
318
319enum VkBlendOp {
320 VK_BLEND_OP_ADD = 0x00000000,
321 VK_BLEND_OP_SUBTRACT = 0x00000001,
322 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
323 VK_BLEND_OP_MIN = 0x00000003,
324 VK_BLEND_OP_MAX = 0x00000004,
325}
326
327enum VkStencilOp {
328 VK_STENCIL_OP_KEEP = 0x00000000,
329 VK_STENCIL_OP_ZERO = 0x00000001,
330 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800331 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
332 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700333 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800334 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
335 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700336}
337
338enum VkLogicOp {
339 VK_LOGIC_OP_CLEAR = 0x00000000,
340 VK_LOGIC_OP_AND = 0x00000001,
341 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
342 VK_LOGIC_OP_COPY = 0x00000003,
343 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800344 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700345 VK_LOGIC_OP_XOR = 0x00000006,
346 VK_LOGIC_OP_OR = 0x00000007,
347 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800348 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700349 VK_LOGIC_OP_INVERT = 0x0000000a,
350 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
351 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
352 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
353 VK_LOGIC_OP_NAND = 0x0000000e,
354 VK_LOGIC_OP_SET = 0x0000000f,
355}
356
Jesse Hall3fbc8562015-11-29 22:10:52 -0800357enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800358 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800359 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
360 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
361 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
362 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800363}
364
Jesse Hall3fbc8562015-11-29 22:10:52 -0800365enum VkInternalAllocationType {
366 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700367}
368
369enum VkPhysicalDeviceType {
370 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
371 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
372 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
373 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
374 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
375}
376
Jesse Hall65ab5522015-11-30 00:07:16 -0800377enum VkVertexInputRate {
378 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
379 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700380}
381
382/// Vulkan format definitions
383enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800384 VK_FORMAT_UNDEFINED = 0,
385 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
386 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
387 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
388 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
389 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
390 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
391 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
392 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
393 VK_FORMAT_R8_UNORM = 9,
394 VK_FORMAT_R8_SNORM = 10,
395 VK_FORMAT_R8_USCALED = 11,
396 VK_FORMAT_R8_SSCALED = 12,
397 VK_FORMAT_R8_UINT = 13,
398 VK_FORMAT_R8_SINT = 14,
399 VK_FORMAT_R8_SRGB = 15,
400 VK_FORMAT_R8G8_UNORM = 16,
401 VK_FORMAT_R8G8_SNORM = 17,
402 VK_FORMAT_R8G8_USCALED = 18,
403 VK_FORMAT_R8G8_SSCALED = 19,
404 VK_FORMAT_R8G8_UINT = 20,
405 VK_FORMAT_R8G8_SINT = 21,
406 VK_FORMAT_R8G8_SRGB = 22,
407 VK_FORMAT_R8G8B8_UNORM = 23,
408 VK_FORMAT_R8G8B8_SNORM = 24,
409 VK_FORMAT_R8G8B8_USCALED = 25,
410 VK_FORMAT_R8G8B8_SSCALED = 26,
411 VK_FORMAT_R8G8B8_UINT = 27,
412 VK_FORMAT_R8G8B8_SINT = 28,
413 VK_FORMAT_R8G8B8_SRGB = 29,
414 VK_FORMAT_B8G8R8_UNORM = 30,
415 VK_FORMAT_B8G8R8_SNORM = 31,
416 VK_FORMAT_B8G8R8_USCALED = 32,
417 VK_FORMAT_B8G8R8_SSCALED = 33,
418 VK_FORMAT_B8G8R8_UINT = 34,
419 VK_FORMAT_B8G8R8_SINT = 35,
420 VK_FORMAT_B8G8R8_SRGB = 36,
421 VK_FORMAT_R8G8B8A8_UNORM = 37,
422 VK_FORMAT_R8G8B8A8_SNORM = 38,
423 VK_FORMAT_R8G8B8A8_USCALED = 39,
424 VK_FORMAT_R8G8B8A8_SSCALED = 40,
425 VK_FORMAT_R8G8B8A8_UINT = 41,
426 VK_FORMAT_R8G8B8A8_SINT = 42,
427 VK_FORMAT_R8G8B8A8_SRGB = 43,
428 VK_FORMAT_B8G8R8A8_UNORM = 44,
429 VK_FORMAT_B8G8R8A8_SNORM = 45,
430 VK_FORMAT_B8G8R8A8_USCALED = 46,
431 VK_FORMAT_B8G8R8A8_SSCALED = 47,
432 VK_FORMAT_B8G8R8A8_UINT = 48,
433 VK_FORMAT_B8G8R8A8_SINT = 49,
434 VK_FORMAT_B8G8R8A8_SRGB = 50,
435 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
436 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
437 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
438 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
439 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
440 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
441 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
442 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
443 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
444 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
445 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
446 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
447 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
448 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
449 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
450 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
451 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
452 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
453 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
454 VK_FORMAT_R16_UNORM = 70,
455 VK_FORMAT_R16_SNORM = 71,
456 VK_FORMAT_R16_USCALED = 72,
457 VK_FORMAT_R16_SSCALED = 73,
458 VK_FORMAT_R16_UINT = 74,
459 VK_FORMAT_R16_SINT = 75,
460 VK_FORMAT_R16_SFLOAT = 76,
461 VK_FORMAT_R16G16_UNORM = 77,
462 VK_FORMAT_R16G16_SNORM = 78,
463 VK_FORMAT_R16G16_USCALED = 79,
464 VK_FORMAT_R16G16_SSCALED = 80,
465 VK_FORMAT_R16G16_UINT = 81,
466 VK_FORMAT_R16G16_SINT = 82,
467 VK_FORMAT_R16G16_SFLOAT = 83,
468 VK_FORMAT_R16G16B16_UNORM = 84,
469 VK_FORMAT_R16G16B16_SNORM = 85,
470 VK_FORMAT_R16G16B16_USCALED = 86,
471 VK_FORMAT_R16G16B16_SSCALED = 87,
472 VK_FORMAT_R16G16B16_UINT = 88,
473 VK_FORMAT_R16G16B16_SINT = 89,
474 VK_FORMAT_R16G16B16_SFLOAT = 90,
475 VK_FORMAT_R16G16B16A16_UNORM = 91,
476 VK_FORMAT_R16G16B16A16_SNORM = 92,
477 VK_FORMAT_R16G16B16A16_USCALED = 93,
478 VK_FORMAT_R16G16B16A16_SSCALED = 94,
479 VK_FORMAT_R16G16B16A16_UINT = 95,
480 VK_FORMAT_R16G16B16A16_SINT = 96,
481 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
482 VK_FORMAT_R32_UINT = 98,
483 VK_FORMAT_R32_SINT = 99,
484 VK_FORMAT_R32_SFLOAT = 100,
485 VK_FORMAT_R32G32_UINT = 101,
486 VK_FORMAT_R32G32_SINT = 102,
487 VK_FORMAT_R32G32_SFLOAT = 103,
488 VK_FORMAT_R32G32B32_UINT = 104,
489 VK_FORMAT_R32G32B32_SINT = 105,
490 VK_FORMAT_R32G32B32_SFLOAT = 106,
491 VK_FORMAT_R32G32B32A32_UINT = 107,
492 VK_FORMAT_R32G32B32A32_SINT = 108,
493 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
494 VK_FORMAT_R64_UINT = 110,
495 VK_FORMAT_R64_SINT = 111,
496 VK_FORMAT_R64_SFLOAT = 112,
497 VK_FORMAT_R64G64_UINT = 113,
498 VK_FORMAT_R64G64_SINT = 114,
499 VK_FORMAT_R64G64_SFLOAT = 115,
500 VK_FORMAT_R64G64B64_UINT = 116,
501 VK_FORMAT_R64G64B64_SINT = 117,
502 VK_FORMAT_R64G64B64_SFLOAT = 118,
503 VK_FORMAT_R64G64B64A64_UINT = 119,
504 VK_FORMAT_R64G64B64A64_SINT = 120,
505 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
506 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
507 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
508 VK_FORMAT_D16_UNORM = 124,
509 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
510 VK_FORMAT_D32_SFLOAT = 126,
511 VK_FORMAT_S8_UINT = 127,
512 VK_FORMAT_D16_UNORM_S8_UINT = 128,
513 VK_FORMAT_D24_UNORM_S8_UINT = 129,
514 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
515 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
516 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
517 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
518 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
519 VK_FORMAT_BC2_UNORM_BLOCK = 135,
520 VK_FORMAT_BC2_SRGB_BLOCK = 136,
521 VK_FORMAT_BC3_UNORM_BLOCK = 137,
522 VK_FORMAT_BC3_SRGB_BLOCK = 138,
523 VK_FORMAT_BC4_UNORM_BLOCK = 139,
524 VK_FORMAT_BC4_SNORM_BLOCK = 140,
525 VK_FORMAT_BC5_UNORM_BLOCK = 141,
526 VK_FORMAT_BC5_SNORM_BLOCK = 142,
527 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
528 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
529 VK_FORMAT_BC7_UNORM_BLOCK = 145,
530 VK_FORMAT_BC7_SRGB_BLOCK = 146,
531 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
532 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
533 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
534 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
535 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
536 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
537 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
538 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
539 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
540 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
541 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
542 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
543 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
544 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
545 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
546 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
547 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
548 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
549 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
550 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
551 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
552 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
553 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
554 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
555 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
556 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
557 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
558 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
559 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
560 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
561 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
562 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
563 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
564 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
565 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
566 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
567 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
568 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700569}
570
Jesse Halld27f6aa2015-08-15 17:58:48 -0700571/// Structure type enumerant
572enum VkStructureType {
573 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800574 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
575 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
576 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
577 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800578 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800579 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
580 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
581 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
582 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700583 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800584 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
585 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
586 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
587 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
588 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
589 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800590 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
591 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
592 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
593 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
594 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
595 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
596 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
597 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
598 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
599 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
600 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
601 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
602 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
603 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
604 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
605 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
606 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800607 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800608 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
609 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
610 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
611 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
612 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800613 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800614 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
615 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
616 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
617 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
618 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
619 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
620 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
621 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800622
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800623 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800624 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
625 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800626
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800627 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800628 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
629 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800630
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800631 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800632 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800633
634 //@extension("VK_KHR_xlib_surface")
635 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
636
637 //@extension("VK_KHR_xcb_surface")
638 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
639
640 //@extension("VK_KHR_wayland_surface")
641 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
642
643 //@extension("VK_KHR_mir_surface")
644 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
645
646 //@extension("VK_KHR_android_surface")
647 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
648
649 //@extension("VK_KHR_win32_surface")
650 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800651
Chia-I Wub262ddc2016-03-22 07:38:20 +0800652 //@extension("VK_ANDROID_native_buffer")
653 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
654
Jesse Hall543a7ff2016-01-08 16:38:30 -0800655 //@extension("VK_EXT_debug_report")
656 VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = 1000011000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700657}
658
Jesse Hall65ab5522015-11-30 00:07:16 -0800659enum VkSubpassContents {
660 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
661 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700662}
663
Jesse Hall543a7ff2016-01-08 16:38:30 -0800664enum VkPipelineCacheHeaderVersion {
665 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
666}
667
Jesse Hallbd888842015-11-30 21:44:14 -0800668@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700669/// Error and return codes
670enum VkResult {
671 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800672 VK_SUCCESS = 0,
673 VK_NOT_READY = 1,
674 VK_TIMEOUT = 2,
675 VK_EVENT_SET = 3,
676 VK_EVENT_RESET = 4,
677 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700678
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800679 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800680 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800681
Jesse Halld27f6aa2015-08-15 17:58:48 -0700682 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800683 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
684 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
685 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
686 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
687 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
688 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
689 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
690 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
691 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
692 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
693 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall1356b0d2015-11-23 17:24:58 -0800694
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800695 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800696 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800697
Jesse Hall563380d2016-01-15 23:14:05 -0800698 //@extension("VK_KHR_surface")
699 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
700
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800701 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800702 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800703
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800704 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800705 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800706
Jesse Hall543a7ff2016-01-08 16:38:30 -0800707 //@extension("VK_EXT_debug_report")
708 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700709}
710
711enum VkDynamicState {
712 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
713 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
714 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
715 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
716 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
717 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
718 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
719 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
720 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700721}
722
Jesse Hall523db342015-11-30 21:12:55 -0800723@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800724enum VkPresentModeKHR {
725 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
726 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
727 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800728 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800729}
730
Jesse Hall523db342015-11-30 21:12:55 -0800731@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800732enum VkColorSpaceKHR {
733 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
734}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700735
Jesse Hall715b86a2016-01-16 16:34:29 -0800736@extension("VK_EXT_debug_report")
737enum VkDebugReportObjectTypeEXT {
738 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
739 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
740 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
741 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
742 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
743 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
744 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
745 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
746 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
747 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
748 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
749 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
750 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
751 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
752 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
753 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
754 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
755 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
756 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
757 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
758 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
759 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
760 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
761 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
762 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
763 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
764 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
765 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
766 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
767}
768
769@extension("VK_EXT_debug_report")
770enum VkDebugReportErrorEXT {
771 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
772 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
773}
774
775
Jesse Halld27f6aa2015-08-15 17:58:48 -0700776/////////////////
777// Bitfields //
778/////////////////
779
Jesse Halld27f6aa2015-08-15 17:58:48 -0700780/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -0800781type VkFlags VkQueueFlags
782bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700783 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
784 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -0800785 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -0800786 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700787}
788
789/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -0800790type VkFlags VkMemoryPropertyFlags
791bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800792 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
793 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
794 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
795 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
796 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700797}
798
799/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -0800800type VkFlags VkMemoryHeapFlags
801bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800802 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700803}
804
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800805/// Access flags
806type VkFlags VkAccessFlags
807bitfield VkAccessFlagBits {
808 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
809 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
810 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
811 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
812 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
813 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
814 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
815 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
816 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
817 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
818 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
819 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
820 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
821 VK_ACCESS_HOST_READ_BIT = 0x00002000,
822 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
823 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
824 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700825}
826
827/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800828type VkFlags VkBufferUsageFlags
829bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800830 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
831 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700832 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
833 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
834 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
835 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
836 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
837 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
838 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
839}
840
841/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800842type VkFlags VkBufferCreateFlags
843bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700844 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700845 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
846 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
847}
848
849/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800850type VkFlags VkShaderStageFlags
851bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700852 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -0800853 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
854 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700855 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
856 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
857 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -0800858 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700859
860 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
861}
862
Jesse Hallfbf97b02015-11-20 14:17:03 -0800863/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -0800864type VkFlags VkDescriptorPoolCreateFlags
865bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800866 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
867}
868
869/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -0800870type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -0800871//bitfield VkDescriptorPoolResetFlagBits {
872//}
Jesse Hallfbf97b02015-11-20 14:17:03 -0800873
Jesse Halld27f6aa2015-08-15 17:58:48 -0700874/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800875type VkFlags VkImageUsageFlags
876bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800877 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
878 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700879 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
880 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
881 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700882 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -0700883 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
884 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
885}
886
887/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800888type VkFlags VkImageCreateFlags
889bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700890 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700891 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
892 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 -0700893 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
894 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 -0700895}
896
Jesse Hallb00daad2015-11-29 19:46:20 -0800897/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800898type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -0800899//bitfield VkImageViewCreateFlagBits {
900//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700901
902/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800903type VkFlags VkPipelineCreateFlags
904bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700905 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
906 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
907 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
908}
909
Jesse Hall65ab5522015-11-30 00:07:16 -0800910/// Color component flags
911type VkFlags VkColorComponentFlags
912bitfield VkColorComponentFlagBits {
913 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
914 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
915 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
916 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700917}
918
919/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800920type VkFlags VkFenceCreateFlags
921bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700922 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
923}
924
925/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800926type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800927//bitfield VkSemaphoreCreateFlagBits {
928//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700929
930/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -0800931type VkFlags VkFormatFeatureFlags
932bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700933 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
934 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
935 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
936 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
937 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
938 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
939 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
940 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
941 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
942 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -0800943 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
944 VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCommandBlitImage
Jesse Hall33faaad2016-01-24 21:00:49 -0800945 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700946}
947
948/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -0800949type VkFlags VkQueryControlFlags
950bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -0800951 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700952}
953
954/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -0800955type VkFlags VkQueryResultFlags
956bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700957 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
958 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
959 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
960 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
961}
962
963/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800964type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800965//bitfield VkShaderModuleCreateFlagBits {
966//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700967
Jesse Halld27f6aa2015-08-15 17:58:48 -0700968/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800969type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800970//bitfield VkEventCreateFlagBits {
971//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700972
Jesse Halla15a4bf2015-11-19 22:48:02 -0800973/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -0800974type VkFlags VkCommandBufferUsageFlags
975bitfield VkCommandBufferUsageFlagBits {
976 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
977 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
978 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700979}
980
981/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -0800982type VkFlags VkQueryPipelineStatisticFlags
983bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -0800984 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
985 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
986 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
987 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
988 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
989 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
990 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
991 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
992 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
993 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
994 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -0700995}
996
997/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -0800998type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -0800999//bitfield VkMemoryMapFlagBits {
1000//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001001
1002/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001003type VkFlags VkImageAspectFlags
1004bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001005 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1006 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1007 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1008 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1009}
1010
1011/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001012type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001013bitfield VkSparseMemoryBindFlagBits {
1014 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1015}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001016
1017/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001018type VkFlags VkSparseImageFormatFlags
1019bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001020 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1021 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.
1022 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001023}
1024
1025/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001026type VkFlags VkPipelineStageFlags
1027bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001028 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1029 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1030 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1031 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001032 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1033 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001034 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1035 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1036 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1037 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1038 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1039 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1040 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001041 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1042 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001043
Jesse Hall543a7ff2016-01-08 16:38:30 -08001044 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1045 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001046}
1047
1048/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001049type VkFlags VkAttachmentDescriptionFlags
1050bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001051 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 -07001052}
1053
1054/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001055type VkFlags VkSubpassDescriptionFlags
1056bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001057}
1058
1059/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001060type VkFlags VkCommandPoolCreateFlags
1061bitfield VkCommandPoolCreateFlagBits {
1062 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1063 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001064}
1065
1066/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001067type VkFlags VkCommandPoolResetFlags
1068bitfield VkCommandPoolResetFlagBits {
1069 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001070}
1071
Jesse Hall3fbc8562015-11-29 22:10:52 -08001072type VkFlags VkCommandBufferResetFlags
1073bitfield VkCommandBufferResetFlagBits {
1074 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001075}
1076
Jesse Halld8bade02015-11-24 10:24:18 -08001077type VkFlags VkSampleCountFlags
1078bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001079 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1080 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1081 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1082 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1083 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1084 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1085 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1086}
1087
Jesse Halld8bade02015-11-24 10:24:18 -08001088type VkFlags VkStencilFaceFlags
1089bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001090 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1091 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001092 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001093}
1094
Jesse Halla6429252015-11-29 18:59:42 -08001095/// Instance creation flags
1096type VkFlags VkInstanceCreateFlags
1097//bitfield VkInstanceCreateFlagBits {
1098//}
1099
1100/// Device creation flags
1101type VkFlags VkDeviceCreateFlags
1102//bitfield VkDeviceCreateFlagBits {
1103//}
1104
1105/// Device queue creation flags
1106type VkFlags VkDeviceQueueCreateFlags
1107//bitfield VkDeviceQueueCreateFlagBits {
1108//}
1109
1110/// Query pool creation flags
1111type VkFlags VkQueryPoolCreateFlags
1112//bitfield VkQueryPoolCreateFlagBits {
1113//}
1114
1115/// Buffer view creation flags
1116type VkFlags VkBufferViewCreateFlags
1117//bitfield VkBufferViewCreateFlagBits {
1118//}
1119
1120/// Pipeline cache creation flags
1121type VkFlags VkPipelineCacheCreateFlags
1122//bitfield VkPipelineCacheCreateFlagBits {
1123//}
1124
1125/// Pipeline shader stage creation flags
1126type VkFlags VkPipelineShaderStageCreateFlags
1127//bitfield VkPipelineShaderStageCreateFlagBits {
1128//}
1129
1130/// Descriptor set layout creation flags
1131type VkFlags VkDescriptorSetLayoutCreateFlags
1132//bitfield VkDescriptorSetLayoutCreateFlagBits {
1133//}
1134
1135/// Pipeline vertex input state creation flags
1136type VkFlags VkPipelineVertexInputStateCreateFlags
1137//bitfield VkPipelineVertexInputStateCreateFlagBits {
1138//}
1139
1140/// Pipeline input assembly state creation flags
1141type VkFlags VkPipelineInputAssemblyStateCreateFlags
1142//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1143//}
1144
1145/// Tessellation state creation flags
1146type VkFlags VkPipelineTessellationStateCreateFlags
1147//bitfield VkPipelineTessellationStateCreateFlagBits {
1148//}
1149
1150/// Viewport state creation flags
1151type VkFlags VkPipelineViewportStateCreateFlags
1152//bitfield VkPipelineViewportStateCreateFlagBits {
1153//}
1154
Jesse Hall3fbc8562015-11-29 22:10:52 -08001155/// Rasterization state creation flags
1156type VkFlags VkPipelineRasterizationStateCreateFlags
1157//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001158//}
1159
1160/// Multisample state creation flags
1161type VkFlags VkPipelineMultisampleStateCreateFlags
1162//bitfield VkPipelineMultisampleStateCreateFlagBits {
1163//}
1164
1165/// Color blend state creation flags
1166type VkFlags VkPipelineColorBlendStateCreateFlags
1167//bitfield VkPipelineColorBlendStateCreateFlagBits {
1168//}
1169
1170/// Depth/stencil state creation flags
1171type VkFlags VkPipelineDepthStencilStateCreateFlags
1172//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1173//}
1174
1175/// Dynamic state creation flags
1176type VkFlags VkPipelineDynamicStateCreateFlags
1177//bitfield VkPipelineDynamicStateCreateFlagBits {
1178//}
1179
1180/// Pipeline layout creation flags
1181type VkFlags VkPipelineLayoutCreateFlags
1182//bitfield VkPipelineLayoutCreateFlagBits {
1183//}
1184
1185/// Sampler creation flags
1186type VkFlags VkSamplerCreateFlags
1187//bitfield VkSamplerCreateFlagBits {
1188//}
1189
1190/// Render pass creation flags
1191type VkFlags VkRenderPassCreateFlags
1192//bitfield VkRenderPassCreateFlagBits {
1193//}
1194
1195/// Framebuffer creation flags
1196type VkFlags VkFramebufferCreateFlags
1197//bitfield VkFramebufferCreateFlagBits {
1198//}
1199
Jesse Halldc6d36c2015-11-29 19:12:15 -08001200/// Dependency flags
1201type VkFlags VkDependencyFlags
1202bitfield VkDependencyFlagBits {
1203 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1204}
1205
Jesse Hallc7467b72015-11-29 21:05:26 -08001206/// Cull mode flags
1207type VkFlags VkCullModeFlags
1208bitfield VkCullModeFlagBits {
1209 VK_CULL_MODE_NONE = 0x00000000,
1210 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1211 VK_CULL_MODE_BACK_BIT = 0x00000002,
1212 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1213}
1214
Jesse Hall523db342015-11-30 21:12:55 -08001215@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001216type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001217@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001218bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001219 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001220 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1221 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1222 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1223 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1224 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1225 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1226 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1227 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001228}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001229
Jesse Hall523db342015-11-30 21:12:55 -08001230@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001231type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001232@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001233bitfield VkCompositeAlphaFlagBitsKHR {
1234 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1235 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1236 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1237 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1238}
1239
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001240@extension("VK_KHR_swapchain")
1241type VkFlags VkSwapchainCreateFlagsKHR
1242//@extension("VK_KHR_swapchain")
1243//bitfield VkSwapchainCreateFlagBitsKHR {
1244//}
1245
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001246@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001247type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001248@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001249bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001250 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1251 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1252 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1253 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001254}
1255
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001256@extension("VK_KHR_display")
1257type VkFlags VkDisplaySurfaceCreateFlagsKHR
1258//@extension("VK_KHR_display")
1259//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1260//}
1261
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001262@extension("VK_KHR_display")
1263type VkFlags VkDisplayModeCreateFlagsKHR
1264//@extension("VK_KHR_display")
1265//bitfield VkDisplayModeCreateFlagBitsKHR {
1266//}
1267
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001268@extension("VK_KHR_xlib_surface")
1269type VkFlags VkXlibSurfaceCreateFlagsKHR
1270//@extension("VK_KHR_xlib_surface")
1271//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1272//}
1273
1274@extension("VK_KHR_xcb_surface")
1275type VkFlags VkXcbSurfaceCreateFlagsKHR
1276//@extension("VK_KHR_xcb_surface")
1277//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1278//}
1279
1280@extension("VK_KHR_wayland_surface")
1281type VkFlags VkWaylandSurfaceCreateFlagsKHR
1282//@extension("VK_KHR_wayland_surface")
1283//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1284//}
1285
1286@extension("VK_KHR_mir_surface")
1287type VkFlags VkMirSurfaceCreateFlagsKHR
1288//@extension("VK_KHR_mir_surface")
1289//bitfield VkMirSurfaceCreateFlagBitsKHR {
1290//}
1291
1292@extension("VK_KHR_android_surface")
1293type VkFlags VkAndroidSurfaceCreateFlagsKHR
1294//@extension("VK_KHR_android_surface")
1295//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1296//}
1297
1298@extension("VK_KHR_win32_surface")
1299type VkFlags VkWin32SurfaceCreateFlagsKHR
1300//@extension("VK_KHR_win32_surface")
1301//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1302//}
1303
Jesse Hall715b86a2016-01-16 16:34:29 -08001304@extension("VK_EXT_debug_report")
1305type VkFlags VkDebugReportFlagsEXT
1306@extension("VK_EXT_debug_report")
1307bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001308 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1309 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1310 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001311 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1312 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1313}
1314
Jesse Hall1356b0d2015-11-23 17:24:58 -08001315
Jesse Halld27f6aa2015-08-15 17:58:48 -07001316//////////////////
1317// Structures //
1318//////////////////
1319
1320class VkOffset2D {
1321 s32 x
1322 s32 y
1323}
1324
1325class VkOffset3D {
1326 s32 x
1327 s32 y
1328 s32 z
1329}
1330
1331class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001332 u32 width
1333 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001334}
1335
1336class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001337 u32 width
1338 u32 height
1339 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001340}
1341
1342class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001343 f32 x
1344 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001345 f32 width
1346 f32 height
1347 f32 minDepth
1348 f32 maxDepth
1349}
1350
1351class VkRect2D {
1352 VkOffset2D offset
1353 VkExtent2D extent
1354}
1355
Jesse Halla15a4bf2015-11-19 22:48:02 -08001356class VkClearRect {
1357 VkRect2D rect
1358 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001359 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001360}
1361
Jesse Hall65ab5522015-11-30 00:07:16 -08001362class VkComponentMapping {
1363 VkComponentSwizzle r
1364 VkComponentSwizzle g
1365 VkComponentSwizzle b
1366 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001367}
1368
1369class VkPhysicalDeviceProperties {
1370 u32 apiVersion
1371 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001372 u32 vendorID
1373 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001374 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001375 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1376 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001377 VkPhysicalDeviceLimits limits
1378 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001379}
1380
1381class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001382 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001383 u32 specVersion /// version of the extension specification implemented
1384}
1385
1386class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001387 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001388 u32 specVersion /// version of the layer specification implemented
1389 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001390 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001391}
1392
Jesse Halla366a512015-11-19 22:30:07 -08001393class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001394 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1395 const void* pNext /// Next structure in chain
1396 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001397 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001398 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001399 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001400 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001401 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001402 const VkSemaphore* pSignalSemaphores
1403}
1404
Jesse Halld27f6aa2015-08-15 17:58:48 -07001405class VkApplicationInfo {
1406 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1407 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001408 const char* pApplicationName
1409 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001410 const char* pEngineName
1411 u32 engineVersion
1412 u32 apiVersion
1413}
1414
Jesse Hall3fbc8562015-11-29 22:10:52 -08001415class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001416 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001417 PFN_vkAllocationFunction pfnAllocation
1418 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001419 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001420 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001421 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001422}
1423
1424class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001425 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1426 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001427 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001428 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001429 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001430 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001431}
1432
1433class VkDeviceCreateInfo {
1434 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1435 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001436 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001437 u32 queueCreateInfoCount
1438 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001439 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001440 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001441 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001442 const char* const* ppEnabledExtensionNames
1443 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001444}
1445
1446class VkInstanceCreateInfo {
1447 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1448 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001449 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001450 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001451 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001452 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001453 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001454 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1455}
1456
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001457class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001458 VkQueueFlags queueFlags /// Queue flags
1459 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001460 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001461 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001462}
1463
1464class VkPhysicalDeviceMemoryProperties {
1465 u32 memoryTypeCount
1466 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1467 u32 memoryHeapCount
1468 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1469}
1470
Jesse Hall3fbc8562015-11-29 22:10:52 -08001471class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001472 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001473 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001474 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001475 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1476}
1477
1478class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001479 VkDeviceSize size /// Specified in bytes
1480 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001481 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1482}
1483
1484class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001485 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001486 VkExtent3D imageGranularity
1487 VkSparseImageFormatFlags flags
1488}
1489
1490class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001491 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001492 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001493 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1494 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1495 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001496}
1497
1498class VkMemoryType {
1499 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1500 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1501}
1502
1503class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001504 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001505 VkMemoryHeapFlags flags /// Flags for the heap
1506}
1507
1508class VkMappedMemoryRange {
1509 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1510 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001511 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001512 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1513 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001514}
1515
1516class VkFormatProperties {
1517 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1518 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001519 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001520}
1521
1522class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001523 VkExtent3D maxExtent /// max image dimensions for this resource type
1524 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001525 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001526 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1527 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1528}
1529
Jesse Halla15a4bf2015-11-19 22:48:02 -08001530class VkDescriptorImageInfo {
1531 VkSampler sampler
1532 VkImageView imageView
1533 VkImageLayout imageLayout
1534}
1535
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001536class VkDescriptorBufferInfo {
1537 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1538 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1539 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001540}
1541
Jesse Halld27f6aa2015-08-15 17:58:48 -07001542class VkWriteDescriptorSet {
1543 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1544 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001545 VkDescriptorSet dstSet /// Destination descriptor set
1546 u32 dstBinding /// Binding within the destination descriptor set to write
1547 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001548 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001549 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 -08001550 const VkDescriptorImageInfo* pImageInfo
1551 const VkDescriptorBufferInfo* pBufferInfo
1552 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001553}
1554
1555class VkCopyDescriptorSet {
1556 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1557 const void* pNext /// Pointer to next structure
1558 VkDescriptorSet srcSet /// Source descriptor set
1559 u32 srcBinding /// Binding within the source descriptor set to copy from
1560 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001561 VkDescriptorSet dstSet /// Destination descriptor set
1562 u32 dstBinding /// Binding within the destination descriptor set to copy to
1563 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001564 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001565}
1566
1567class VkBufferCreateInfo {
1568 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1569 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001570 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001571 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001572 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001573 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001574 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001575 const u32* pQueueFamilyIndices
1576}
1577
1578class VkBufferViewCreateInfo {
1579 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1580 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001581 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001582 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001583 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001584 VkDeviceSize offset /// Specified in bytes
1585 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001586}
1587
1588class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001589 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001590 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001591 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001592}
1593
1594class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001595 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001596 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001597 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001598 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001599 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001600}
1601
1602class VkMemoryBarrier {
1603 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1604 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001605 VkAccessFlags srcAccessMask
1606 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001607}
1608
1609class VkBufferMemoryBarrier {
1610 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1611 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001612 VkAccessFlags srcAccessMask
1613 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001614 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001615 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001616 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001617 VkDeviceSize offset /// Offset within the buffer to sync
1618 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001619}
1620
1621class VkImageMemoryBarrier {
1622 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1623 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001624 VkAccessFlags srcAccessMask
1625 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001626 VkImageLayout oldLayout /// Current layout of the image
1627 VkImageLayout newLayout /// New layout to transition the image to
1628 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001629 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001630 VkImage image /// Image to sync
1631 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1632}
1633
1634class VkImageCreateInfo {
1635 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1636 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001637 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001638 VkImageType imageType
1639 VkFormat format
1640 VkExtent3D extent
1641 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001642 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001643 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001644 VkImageTiling tiling
1645 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001646 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001647 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001648 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001649 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001650}
1651
1652class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001653 VkDeviceSize offset /// Specified in bytes
1654 VkDeviceSize size /// Specified in bytes
1655 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001656 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001657 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001658}
1659
1660class VkImageViewCreateInfo {
1661 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1662 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001663 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001664 VkImage image
1665 VkImageViewType viewType
1666 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001667 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001668 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001669}
1670
1671class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001672 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001673 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001674 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001675}
1676
Jesse Halla6429252015-11-29 18:59:42 -08001677class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001678 VkDeviceSize resourceOffset /// Specified in bytes
1679 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001680 VkDeviceMemory memory
1681 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001682 VkSparseMemoryBindFlags flags
1683}
1684
Jesse Halla6429252015-11-29 18:59:42 -08001685class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001686 VkImageSubresource subresource
1687 VkOffset3D offset
1688 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001689 VkDeviceMemory memory
1690 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001691 VkSparseMemoryBindFlags flags
1692}
1693
Jesse Halla6429252015-11-29 18:59:42 -08001694class VkSparseBufferMemoryBindInfo {
1695 VkBuffer buffer
1696 u32 bindCount
1697 const VkSparseMemoryBind* pBinds
1698}
1699
1700class VkSparseImageOpaqueMemoryBindInfo {
1701 VkImage image
1702 u32 bindCount
1703 const VkSparseMemoryBind* pBinds
1704}
1705
1706class VkSparseImageMemoryBindInfo {
1707 VkImage image
1708 u32 bindCount
1709 const VkSparseMemoryBind* pBinds
1710}
1711
1712class VkBindSparseInfo {
1713 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1714 const void* pNext
1715 u32 waitSemaphoreCount
1716 const VkSemaphore* pWaitSemaphores
1717 u32 numBufferBinds
1718 const VkSparseBufferMemoryBindInfo* pBufferBinds
1719 u32 numImageOpaqueBinds
1720 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1721 u32 numImageBinds
1722 const VkSparseImageMemoryBindInfo* pImageBinds
1723 u32 signalSemaphoreCount
1724 const VkSemaphore* pSignalSemaphores
1725}
1726
Jesse Hall65ab5522015-11-30 00:07:16 -08001727class VkImageSubresourceLayers {
1728 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001729 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001730 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001731 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001732}
1733
Jesse Halld27f6aa2015-08-15 17:58:48 -07001734class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001735 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001736 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001737 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001738 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001739 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1740}
1741
1742class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001743 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001744 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08001745 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001746 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07001747}
1748
1749class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001750 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001751 u32 bufferRowLength /// Specified in texels
1752 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001753 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001754 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1755 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1756}
1757
1758class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001759 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001760 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001761 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001762 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001763 VkExtent3D extent
1764}
1765
1766class VkShaderModuleCreateInfo {
1767 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1768 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001769 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001770 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08001771 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07001772}
1773
Jesse Halld27f6aa2015-08-15 17:58:48 -07001774class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08001775 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001776 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08001777 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001778 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
1779 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
1780}
1781
1782class VkDescriptorSetLayoutCreateInfo {
1783 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
1784 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001785 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001786 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08001787 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001788}
1789
Jesse Hall65ab5522015-11-30 00:07:16 -08001790class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001791 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08001792 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001793}
1794
1795class VkDescriptorPoolCreateInfo {
1796 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
1797 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08001798 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001799 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08001800 u32 poolSizeCount
1801 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001802}
1803
Jesse Hall3fbc8562015-11-29 22:10:52 -08001804class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001805 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08001806 const void* pNext /// Pointer to next structure
1807 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08001808 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001809 const VkDescriptorSetLayout* pSetLayouts
1810}
1811
Jesse Halld27f6aa2015-08-15 17:58:48 -07001812class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08001813 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07001814 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08001815 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07001816}
1817
1818class VkSpecializationInfo {
1819 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08001820 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07001821 platform.size_t dataSize /// Size in bytes of pData
1822 const void* pData /// Pointer to SpecConstant data
1823}
1824
1825class VkPipelineShaderStageCreateInfo {
1826 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
1827 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001828 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001829 VkShaderStageFlagBits stage
1830 VkShaderModule module
1831 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07001832 const VkSpecializationInfo* pSpecializationInfo
1833}
1834
1835class VkComputePipelineCreateInfo {
1836 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
1837 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001838 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001839 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001840 VkPipelineLayout layout /// Interface layout of the pipeline
1841 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
1842 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
1843}
1844
1845class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001846 u32 binding /// Vertex buffer binding id
1847 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08001848 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07001849}
1850
1851class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001852 u32 location /// location of the shader vertex attrib
1853 u32 binding /// Vertex buffer binding id
1854 VkFormat format /// format of source data
1855 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001856}
1857
1858class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001859 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
1860 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001861 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001862 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001863 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08001864 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001865 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1866}
1867
1868class VkPipelineInputAssemblyStateCreateInfo {
1869 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
1870 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001871 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001872 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001873 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001874}
1875
1876class VkPipelineTessellationStateCreateInfo {
1877 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
1878 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001879 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001880 u32 patchControlPoints
1881}
1882
1883class VkPipelineViewportStateCreateInfo {
1884 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
1885 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001886 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001887 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001888 const VkViewport* pViewports
1889 u32 scissorCount
1890 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07001891}
1892
Jesse Hall3fbc8562015-11-29 22:10:52 -08001893class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08001894 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001895 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001896 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001897 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001898 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001899 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08001900 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07001901 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001902 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08001903 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001904 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08001905 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001906 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001907}
1908
1909class VkPipelineMultisampleStateCreateInfo {
1910 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
1911 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001912 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001913 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001914 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001915 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001916 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08001917 VkBool32 alphaToCoverageEnable
1918 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001919}
1920
1921class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001922 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001923 VkBlendFactor srcColorBlendFactor
1924 VkBlendFactor dstColorBlendFactor
1925 VkBlendOp colorBlendOp
1926 VkBlendFactor srcAlphaBlendFactor
1927 VkBlendFactor dstAlphaBlendFactor
1928 VkBlendOp alphaBlendOp
1929 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001930}
1931
1932class VkPipelineColorBlendStateCreateInfo {
1933 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
1934 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001935 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001936 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001937 VkLogicOp logicOp
1938 u32 attachmentCount /// # of pAttachments
1939 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08001940 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07001941}
1942
1943class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08001944 VkStencilOp failOp
1945 VkStencilOp passOp
1946 VkStencilOp depthFailOp
1947 VkCompareOp compareOp
1948 u32 compareMask
1949 u32 writeMask
1950 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07001951}
1952
1953class VkPipelineDepthStencilStateCreateInfo {
1954 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
1955 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001956 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001957 VkBool32 depthTestEnable
1958 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001959 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001960 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
1961 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001962 VkStencilOpState front
1963 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001964 f32 minDepthBounds
1965 f32 maxDepthBounds
1966}
1967
1968class VkPipelineDynamicStateCreateInfo {
1969 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
1970 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001971 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001972 u32 dynamicStateCount
1973 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001974}
1975
1976class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08001977 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
1978 const void* pNext /// Pointer to next structure
1979 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001980 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08001981 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001982 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
1983 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
1984 const VkPipelineTessellationStateCreateInfo* pTessellationState
1985 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08001986 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07001987 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
1988 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
1989 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001990 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08001991 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001992 VkRenderPass renderPass
1993 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08001994 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
1995 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 -07001996}
1997
1998class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08001999 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2000 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002001 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002002 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2003 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002004}
2005
2006class VkPushConstantRange {
2007 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002008 u32 offset /// Start of the range, in bytes
2009 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002010}
2011
2012class VkPipelineLayoutCreateInfo {
2013 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2014 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002015 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002016 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002017 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2018 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2019 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2020}
2021
2022class VkSamplerCreateInfo {
2023 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2024 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002025 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002026 VkFilter magFilter /// Filter mode for magnification
2027 VkFilter minFilter /// Filter mode for minifiation
2028 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2029 VkSamplerAddressMode addressModeU
2030 VkSamplerAddressMode addressModeV
2031 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002032 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002033 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002034 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002035 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002036 VkCompareOp compareOp
2037 f32 minLod
2038 f32 maxLod
2039 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002040 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002041}
2042
Jesse Hall3fbc8562015-11-29 22:10:52 -08002043class VkCommandPoolCreateInfo {
2044 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002045 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002046 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002047 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002048}
2049
Jesse Hall3fbc8562015-11-29 22:10:52 -08002050class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002051 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002052 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002053 VkCommandPool commandPool
2054 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002055 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002056}
2057
Jesse Hall3dd678a2016-01-08 21:52:01 -08002058class VkCommandBufferInheritanceInfo {
2059 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002060 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002061 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002062 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002063 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002064 VkBool32 occlusionQueryEnable
2065 VkQueryControlFlags queryFlags
2066 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002067}
2068
Jesse Hall3dd678a2016-01-08 21:52:01 -08002069class VkCommandBufferBeginInfo {
2070 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2071 const void* pNext /// Pointer to next structure
2072 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2073 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2074}
2075
Jesse Halld27f6aa2015-08-15 17:58:48 -07002076class VkRenderPassBeginInfo {
2077 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2078 const void* pNext /// Pointer to next structure
2079 VkRenderPass renderPass
2080 VkFramebuffer framebuffer
2081 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002082 u32 clearValueCount
2083 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002084}
2085
2086@union
2087/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2088class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002089 f32[4] float32
2090 s32[4] int32
2091 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002092}
2093
2094class VkClearDepthStencilValue {
2095 f32 depth
2096 u32 stencil
2097}
2098
2099@union
2100/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2101class VkClearValue {
2102 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002103 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002104}
2105
Jesse Hallae38f732015-11-19 21:32:50 -08002106class VkClearAttachment {
2107 VkImageAspectFlags aspectMask
2108 u32 colorAttachment
2109 VkClearValue clearValue
2110}
2111
Jesse Halld27f6aa2015-08-15 17:58:48 -07002112class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002113 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002114 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002115 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002116 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2117 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2118 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2119 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2120 VkImageLayout initialLayout
2121 VkImageLayout finalLayout
2122}
2123
2124class VkAttachmentReference {
2125 u32 attachment
2126 VkImageLayout layout
2127}
2128
2129class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002130 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002131 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002132 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002133 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002134 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002135 const VkAttachmentReference* pColorAttachments
2136 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002137 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002138 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002139 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002140}
2141
2142class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002143 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002144 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002145 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002146 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002147 VkAccessFlags srcAccessMask
2148 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002149 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002150}
2151
2152class VkRenderPassCreateInfo {
2153 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2154 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002155 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002156 u32 attachmentCount
2157 const VkAttachmentDescription* pAttachments
2158 u32 subpassCount
2159 const VkSubpassDescription* pSubpasses
2160 u32 dependencyCount
2161 const VkSubpassDependency* pDependencies
2162}
2163
2164class VkEventCreateInfo {
2165 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2166 const void* pNext /// Pointer to next structure
2167 VkEventCreateFlags flags /// Event creation flags
2168}
2169
2170class VkFenceCreateInfo {
2171 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2172 const void* pNext /// Pointer to next structure
2173 VkFenceCreateFlags flags /// Fence creation flags
2174}
2175
2176class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002177 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2178 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2179 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2180 VkBool32 independentBlend /// blending operations are controlled per-attachment
2181 VkBool32 geometryShader /// geometry stage
2182 VkBool32 tessellationShader /// tessellation control and evaluation stage
2183 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002184 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002185 VkBool32 logicOp /// logic operations
2186 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002187 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002188 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002189 VkBool32 depthBiasClamp /// depth bias clamping
2190 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2191 VkBool32 depthBounds /// depth bounds test
2192 VkBool32 wideLines /// lines with width greater than 1
2193 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002194 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2195 VkBool32 multiViewport
2196 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002197 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2198 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2199 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002200 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002201 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002202 VkBool32 vertexPipelineStoresAndAtomics
2203 VkBool32 fragmentStoresAndAtomics
2204 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002205 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2206 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2207 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002208 VkBool32 shaderStorageImageReadWithoutFormat
2209 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002210 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2211 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2212 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2213 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2214 VkBool32 shaderClipDistance /// clip distance in shaders
2215 VkBool32 shaderCullDistance /// cull distance in shaders
2216 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2217 VkBool32 shaderInt64 /// 64-bit integers in shaders
2218 VkBool32 shaderInt16 /// 16-bit integers in shaders
2219 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002220 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002221 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2222 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2223 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2224 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2225 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2226 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2227 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2228 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2229 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002230 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002231 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002232}
2233
2234class VkPhysicalDeviceLimits {
2235 /// resource maximum sizes
2236 u32 maxImageDimension1D /// max 1D image dimension
2237 u32 maxImageDimension2D /// max 2D image dimension
2238 u32 maxImageDimension3D /// max 3D image dimension
2239 u32 maxImageDimensionCube /// max cubemap image dimension
2240 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002241 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002242 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2243 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002244 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2245 /// memory limits
2246 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002247 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002248 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2249 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002250 /// descriptor set limits
2251 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002252 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2253 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2254 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2255 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2256 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002257 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002258 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002259 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2260 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002261 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002262 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002263 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002264 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2265 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002266 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002267 /// vertex stage limits
2268 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002269 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002270 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2271 u32 maxVertexInputBindingStride /// max vertex input binding stride
2272 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2273 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002274 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002275 u32 maxTessellationPatchSize /// max patch size (vertices)
2276 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2277 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2278 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2279 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2280 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2281 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002282 /// geometry stage limits
2283 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2284 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2285 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2286 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2287 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2288 /// fragment stage limits
2289 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002290 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002291 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002292 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2293 /// compute stage limits
2294 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2295 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2296 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2297 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2298
2299 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2300 u32 subTexelPrecisionBits /// num bits of subtexel precision
2301 u32 mipmapPrecisionBits /// num bits of mipmap precision
2302
2303 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002304 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002305
2306 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2307 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2308
2309 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002310 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2311 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2312 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2313
Jesse Halldc6d36c2015-11-29 19:12:15 -08002314 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2315 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2316 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2317 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002318
Jesse Hallfbf97b02015-11-20 14:17:03 -08002319 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002320 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002321 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002322 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2323 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2324 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2325 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2326
2327 u32 maxFramebufferWidth /// max width for a framebuffer
2328 u32 maxFramebufferHeight /// max height for a framebuffer
2329 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002330 VkSampleCountFlags framebufferColorSampleCounts
2331 VkSampleCountFlags framebufferDepthSampleCounts
2332 VkSampleCountFlags framebufferStencilSampleCounts
2333 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002334 u32 maxColorAttachments /// max num of framebuffer color attachments
2335
Jesse Hall091ed9e2015-11-30 00:55:29 -08002336 VkSampleCountFlags sampledImageColorSampleCounts
2337 VkSampleCountFlags sampledImageIntegerSampleCounts
2338 VkSampleCountFlags sampledImageDepthSampleCounts
2339 VkSampleCountFlags sampledImageStencilSampleCounts
2340 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002341 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002342 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002343
Jesse Halla9bb62b2015-11-21 19:31:56 -08002344 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002345
2346 u32 maxClipDistances /// max number of clip distances
2347 u32 maxCullDistances /// max number of cull distances
2348 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2349
Jesse Hallfbf97b02015-11-20 14:17:03 -08002350 u32 discreteQueuePriorities
2351
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002352 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2353 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002354 f32 pointSizeGranularity /// granularity of supported point sizes
2355 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002356 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002357 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002358
Jesse Hall65ab5522015-11-30 00:07:16 -08002359 VkDeviceSize optimalBufferCopyOffsetAlignment
2360 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002361 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002362}
2363
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002364class VkPhysicalDeviceSparseProperties {
2365 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 -08002366 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 -07002367 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2368 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 -07002369 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
2370}
2371
Jesse Halld27f6aa2015-08-15 17:58:48 -07002372class VkSemaphoreCreateInfo {
2373 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2374 const void* pNext /// Pointer to next structure
2375 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2376}
2377
2378class VkQueryPoolCreateInfo {
2379 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2380 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002381 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002382 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002383 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002384 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2385}
2386
2387class VkFramebufferCreateInfo {
2388 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2389 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002390 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002391 VkRenderPass renderPass
2392 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002393 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002394 u32 width
2395 u32 height
2396 u32 layers
2397}
2398
Jesse Hall3fbc8562015-11-29 22:10:52 -08002399class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002400 u32 vertexCount
2401 u32 instanceCount
2402 u32 firstVertex
2403 u32 firstInstance
2404}
2405
Jesse Hall3fbc8562015-11-29 22:10:52 -08002406class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002407 u32 indexCount
2408 u32 instanceCount
2409 u32 firstIndex
2410 s32 vertexOffset
2411 u32 firstInstance
2412}
2413
Jesse Hall3fbc8562015-11-29 22:10:52 -08002414class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002415 u32 x
2416 u32 y
2417 u32 z
2418}
2419
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002420@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002421class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002422 u32 minImageCount
2423 u32 maxImageCount
2424 VkExtent2D currentExtent
2425 VkExtent2D minImageExtent
2426 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002427 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002428 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002429 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002430 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002431 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002432}
2433
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002434@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002435class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002436 VkFormat format
2437 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002438}
2439
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002440@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002441class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002442 VkStructureType sType
2443 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002444 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002445 VkSurfaceKHR surface
2446 u32 minImageCount
2447 VkFormat imageFormat
2448 VkColorSpaceKHR imageColorSpace
2449 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002450 u32 imageArrayLayers
2451 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002452 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002453 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002454 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002455 VkSurfaceTransformFlagBitsKHR preTransform
2456 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002457 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002458 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002459 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002460}
2461
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002462@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002463class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002464 VkStructureType sType
2465 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002466 u32 waitSemaphoreCount
2467 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002468 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002469 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002470 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002471 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002472}
2473
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002474@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002475class VkDisplayPropertiesKHR {
2476 VkDisplayKHR display
2477 const char* displayName
2478 VkExtent2D physicalDimensions
2479 VkExtent2D physicalResolution
2480 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002481 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002482 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002483}
2484
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002485@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002486class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002487 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002488 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002489}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002490
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002491@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002492class VkDisplayModePropertiesKHR {
2493 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002494 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002495}
2496
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002497@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002498class VkDisplayModeCreateInfoKHR {
2499 VkStructureType sType
2500 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002501 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002502 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002503}
2504
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002505@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002506class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002507 VkDisplayKHR currentDisplay
2508 u32 currentStackIndex
2509}
2510
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002511@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002512class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002513 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2514 VkOffset2D minSrcPosition
2515 VkOffset2D maxSrcPosition
2516 VkExtent2D minSrcExtent
2517 VkExtent2D maxSrcExtent
2518 VkOffset2D minDstPosition
2519 VkOffset2D maxDstPosition
2520 VkExtent2D minDstExtent
2521 VkExtent2D maxDstExtent
2522}
2523
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002524@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002525class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002526 VkStructureType sType
2527 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002528 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002529 VkDisplayModeKHR displayMode
2530 u32 planeIndex
2531 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002532 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002533 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002534 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2535 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002536}
2537
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002538@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002539class VkDisplayPresentInfoKHR {
2540 VkStructureType sType
2541 const void* pNext
2542 VkRect2D srcRect
2543 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002544 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002545}
2546
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002547@extension("VK_KHR_xlib_surface")
2548class VkXlibSurfaceCreateInfoKHR {
2549 VkStructureType sType
2550 const void* pNext
2551 VkXlibSurfaceCreateFlagsKHR flags
2552 platform.Display* dpy
2553 platform.Window window
2554}
2555
2556@extension("VK_KHR_xcb_surface")
2557class VkXcbSurfaceCreateInfoKHR {
2558 VkStructureType sType
2559 const void* pNext
2560 VkXcbSurfaceCreateFlagsKHR flags
2561 platform.xcb_connection_t* connection
2562 platform.xcb_window_t window
2563}
2564
2565@extension("VK_KHR_wayland_surface")
2566class VkWaylandSurfaceCreateInfoKHR {
2567 VkStructureType sType
2568 const void* pNext
2569 VkWaylandSurfaceCreateFlagsKHR flags
2570 platform.wl_display* display
2571 platform.wl_surface* surface
2572}
2573
2574@extension("VK_KHR_mir_surface")
2575class VkMirSurfaceCreateInfoKHR {
2576 VkStructureType sType
2577 const void* pNext
2578 VkMirSurfaceCreateFlagsKHR flags
2579 platform.MirConnection* connection
2580 platform.MirSurface* mirSurface
2581}
2582
2583@extension("VK_KHR_android_surface")
2584class VkAndroidSurfaceCreateInfoKHR {
2585 VkStructureType sType
2586 const void* pNext
2587 VkAndroidSurfaceCreateFlagsKHR flags
2588 platform.ANativeWindow* window
2589}
2590
2591@extension("VK_KHR_win32_surface")
2592class VkWin32SurfaceCreateInfoKHR {
2593 VkStructureType sType
2594 const void* pNext
2595 VkWin32SurfaceCreateFlagsKHR flags
2596 platform.HINSTANCE hinstance
2597 platform.HWND hwnd
2598}
2599
Chia-I Wub262ddc2016-03-22 07:38:20 +08002600@extension("VK_ANDROID_native_buffer")
2601class VkNativeBufferANDROID {
2602 VkStructureType sType
2603 const void* pNext
2604 platform.buffer_handle_t handle
2605 int stride
2606 int format
2607 int usage
2608}
2609
Jesse Hall715b86a2016-01-16 16:34:29 -08002610@extension("VK_EXT_debug_report")
2611class VkDebugReportCallbackCreateInfoEXT {
2612 VkStructureType sType
2613 const void* pNext
2614 VkDebugReportFlagsEXT flags
2615 PFN_vkDebugReportCallbackEXT pfnCallback
2616 void* pUserData
2617}
2618
Jesse Hall1356b0d2015-11-23 17:24:58 -08002619
Jesse Halld27f6aa2015-08-15 17:58:48 -07002620////////////////
2621// Commands //
2622////////////////
2623
2624// Function pointers. TODO: add support for function pointers.
2625
2626@external type void* PFN_vkVoidFunction
2627@pfn cmd void vkVoidFunction() {
2628}
2629
Jesse Hall3fbc8562015-11-29 22:10:52 -08002630@external type void* PFN_vkAllocationFunction
2631@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002632 void* pUserData,
2633 platform.size_t size,
2634 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002635 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002636 return ?
2637}
2638
Jesse Hall3fbc8562015-11-29 22:10:52 -08002639@external type void* PFN_vkReallocationFunction
2640@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002641 void* pUserData,
2642 void* pOriginal,
2643 platform.size_t size,
2644 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002645 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002646 return ?
2647}
2648
2649@external type void* PFN_vkFreeFunction
2650@pfn cmd void vkFreeFunction(
2651 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002652 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002653}
2654
Jesse Hall3fbc8562015-11-29 22:10:52 -08002655@external type void* PFN_vkInternalAllocationNotification
2656@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002657 void* pUserData,
2658 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002659 VkInternalAllocationType allocationType,
2660 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002661}
2662
2663@external type void* PFN_vkInternalFreeNotification
2664@pfn cmd void vkInternalFreeNotification(
2665 void* pUserData,
2666 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002667 VkInternalAllocationType allocationType,
2668 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002669}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002670
2671// Global functions
2672
2673@threadSafety("system")
2674cmd VkResult vkCreateInstance(
2675 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002676 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002677 VkInstance* pInstance) {
2678 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
2679
2680 instance := ?
2681 pInstance[0] = instance
2682 State.Instances[instance] = new!InstanceObject()
2683
Jesse Hall3dd678a2016-01-08 21:52:01 -08002684 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
2685 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07002686
2687 return ?
2688}
2689
2690@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002691cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002692 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002693 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002694 instanceObject := GetInstance(instance)
2695
2696 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002697}
2698
2699@threadSafety("system")
2700cmd VkResult vkEnumeratePhysicalDevices(
2701 VkInstance instance,
2702 u32* pPhysicalDeviceCount,
2703 VkPhysicalDevice* pPhysicalDevices) {
2704 instanceObject := GetInstance(instance)
2705
2706 physicalDeviceCount := as!u32(?)
2707 pPhysicalDeviceCount[0] = physicalDeviceCount
2708 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
2709
2710 for i in (0 .. physicalDeviceCount) {
2711 physicalDevice := ?
2712 physicalDevices[i] = physicalDevice
2713 if !(physicalDevice in State.PhysicalDevices) {
2714 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
2715 }
2716 }
2717
2718 return ?
2719}
2720
2721cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
2722 VkDevice device,
2723 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002724 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002725 device := GetDevice(device)
2726 }
2727
2728 return ?
2729}
2730
2731cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
2732 VkInstance instance,
2733 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002734 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002735 instanceObject := GetInstance(instance)
2736 }
2737
2738 return ?
2739}
2740
Jesse Hall606a54e2015-11-19 22:17:28 -08002741cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002742 VkPhysicalDevice physicalDevice,
2743 VkPhysicalDeviceProperties* pProperties) {
2744 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2745
2746 properties := ?
2747 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002748}
2749
Jesse Hall606a54e2015-11-19 22:17:28 -08002750cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002751 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002752 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002753 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002754 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002755 // TODO: Figure out how to express fetch-count-or-properties
2756 // This version fails 'apic validate' with 'fence not allowed in
2757 // *semantic.Branch'. Other attempts have failed with the same or other
2758 // errors.
2759 // if pQueueFamilyProperties != null {
2760 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
2761 // for i in (0 .. pCount[0]) {
2762 // queueProperties := as!VkQueueFamilyProperties(?)
2763 // queuesProperties[i] = queueProperties
2764 // }
2765 // } else {
2766 // count := ?
2767 // pCount[0] = count
2768 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002769}
2770
Jesse Hall606a54e2015-11-19 22:17:28 -08002771cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002772 VkPhysicalDevice physicalDevice,
2773 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
2774 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2775
2776 memoryProperties := ?
2777 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002778}
2779
Jesse Hall606a54e2015-11-19 22:17:28 -08002780cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002781 VkPhysicalDevice physicalDevice,
2782 VkPhysicalDeviceFeatures* pFeatures) {
2783 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2784
2785 features := ?
2786 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07002787}
2788
Jesse Hall606a54e2015-11-19 22:17:28 -08002789cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002790 VkPhysicalDevice physicalDevice,
2791 VkFormat format,
2792 VkFormatProperties* pFormatProperties) {
2793 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2794
2795 formatProperties := ?
2796 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002797}
2798
Jesse Halla9e57032015-11-30 01:03:10 -08002799cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002800 VkPhysicalDevice physicalDevice,
2801 VkFormat format,
2802 VkImageType type,
2803 VkImageTiling tiling,
2804 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002805 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002806 VkImageFormatProperties* pImageFormatProperties) {
2807 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2808
2809 imageFormatProperties := ?
2810 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08002811
2812 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07002813}
2814
Jesse Halld27f6aa2015-08-15 17:58:48 -07002815
2816// Device functions
2817
2818@threadSafety("system")
2819cmd VkResult vkCreateDevice(
2820 VkPhysicalDevice physicalDevice,
2821 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002822 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002823 VkDevice* pDevice) {
2824 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
2825 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2826
2827 device := ?
2828 pDevice[0] = device
2829 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
2830
2831 return ?
2832}
2833
2834@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002835cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002836 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002837 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002838 deviceObject := GetDevice(device)
2839
2840 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002841}
2842
2843
2844// Extension discovery functions
2845
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002846cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002847 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002848 VkLayerProperties* pProperties) {
2849 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002850 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002851
2852 properties := pProperties[0:count]
2853 for i in (0 .. count) {
2854 property := ?
2855 properties[i] = property
2856 }
2857
2858 return ?
2859}
2860
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002861cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002862 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002863 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002864 VkExtensionProperties* pProperties) {
2865 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002866 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002867
2868 properties := pProperties[0:count]
2869 for i in (0 .. count) {
2870 property := ?
2871 properties[i] = property
2872 }
2873
2874 return ?
2875}
2876
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002877cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002878 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002879 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002880 VkLayerProperties* pProperties) {
2881 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2882 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002883 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002884
2885 properties := pProperties[0:count]
2886 for i in (0 .. count) {
2887 property := ?
2888 properties[i] = property
2889 }
2890
2891 return ?
2892}
2893
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002894cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002895 VkPhysicalDevice physicalDevice,
2896 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002897 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002898 VkExtensionProperties* pProperties) {
2899 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2900
2901 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002902 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002903
2904 properties := pProperties[0:count]
2905 for i in (0 .. count) {
2906 property := ?
2907 properties[i] = property
2908 }
2909
2910 return ?
2911}
2912
2913
2914// Queue functions
2915
2916@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08002917cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002918 VkDevice device,
2919 u32 queueFamilyIndex,
2920 u32 queueIndex,
2921 VkQueue* pQueue) {
2922 deviceObject := GetDevice(device)
2923
2924 queue := ?
2925 pQueue[0] = queue
2926
2927 if !(queue in State.Queues) {
2928 State.Queues[queue] = new!QueueObject(device: device)
2929 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002930}
2931
2932@threadSafety("app")
2933cmd VkResult vkQueueSubmit(
2934 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08002935 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08002936 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002937 VkFence fence) {
2938 queueObject := GetQueue(queue)
2939
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002940 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002941 fenceObject := GetFence(fence)
2942 assert(fenceObject.device == queueObject.device)
2943 }
2944
Jesse Hall3fbc8562015-11-29 22:10:52 -08002945 // commandBuffers := pcommandBuffers[0:commandBufferCount]
2946 // for i in (0 .. commandBufferCount) {
2947 // commandBuffer := commandBuffers[i]
2948 // commandBufferObject := GetCommandBuffer(commandBuffer)
2949 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08002950 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08002951 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
2952 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08002953 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002954
2955 return ?
2956}
2957
2958@threadSafety("system")
2959cmd VkResult vkQueueWaitIdle(
2960 VkQueue queue) {
2961 queueObject := GetQueue(queue)
2962
2963 return ?
2964}
2965
2966@threadSafety("system")
2967cmd VkResult vkDeviceWaitIdle(
2968 VkDevice device) {
2969 deviceObject := GetDevice(device)
2970
2971 return ?
2972}
2973
2974
2975// Memory functions
2976
2977@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002978cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002979 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002980 const VkMemoryAllocateInfo* pAllocateInfo,
2981 const VkAllocationCallbacks* pAllocator,
2982 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002983 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002984 deviceObject := GetDevice(device)
2985
Jesse Hall3fbc8562015-11-29 22:10:52 -08002986 memory := ?
2987 pMemory[0] = memory
2988 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002989 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002990 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002991
2992 return ?
2993}
2994
2995@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002996cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002997 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002998 VkDeviceMemory memory,
2999 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003000 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003001 memoryObject := GetDeviceMemory(memory)
3002 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003003
3004 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003005 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003006 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003007 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3008 "vkFreeMemory: commandBuffers still bound")
3009 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003010}
3011
3012@threadSafety("app")
3013cmd VkResult vkMapMemory(
3014 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003015 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003016 VkDeviceSize offset,
3017 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003018 VkMemoryMapFlags flags,
3019 void** ppData) {
3020 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003021 memoryObject := GetDeviceMemory(memory)
3022 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003023
3024 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003025 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003026
3027 return ?
3028}
3029
3030@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003031cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003032 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003033 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003034 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003035 memoryObject := GetDeviceMemory(memory)
3036 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003037}
3038
3039cmd VkResult vkFlushMappedMemoryRanges(
3040 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003041 u32 memoryRangeCount
3042 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003043 deviceObject := GetDevice(device)
3044
Jesse Hall3fbc8562015-11-29 22:10:52 -08003045 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3046 for i in (0 .. memoryRangeCount) {
3047 memoryRange := memoryRanges[i]
3048 memoryObject := GetDeviceMemory(memoryRange.memory)
3049 assert(memoryObject.device == device)
3050 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003051 }
3052
3053 return ?
3054}
3055
3056cmd VkResult vkInvalidateMappedMemoryRanges(
3057 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003058 u32 memoryRangeCount,
3059 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003060 deviceObject := GetDevice(device)
3061
Jesse Hall3fbc8562015-11-29 22:10:52 -08003062 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3063 for i in (0 .. memoryRangeCount) {
3064 memoryRange := memoryRanges[i]
3065 memoryObject := GetDeviceMemory(memoryRange.memory)
3066 assert(memoryObject.device == device)
3067 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003068 }
3069
3070 return ?
3071}
3072
3073
3074// Memory management API functions
3075
Jesse Hall606a54e2015-11-19 22:17:28 -08003076cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003077 VkDevice device,
3078 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003079 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003080 deviceObject := GetDevice(device)
3081
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003082 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003083 memoryObject := GetDeviceMemory(memory)
3084 assert(memoryObject.device == device)
3085 }
3086
3087 committedMemoryInBytes := ?
3088 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003089}
3090
Jesse Hall606a54e2015-11-19 22:17:28 -08003091cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003092 VkDevice device,
3093 VkBuffer buffer,
3094 VkMemoryRequirements* pMemoryRequirements) {
3095 deviceObject := GetDevice(device)
3096 bufferObject := GetBuffer(buffer)
3097 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003098}
3099
3100cmd VkResult vkBindBufferMemory(
3101 VkDevice device,
3102 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003103 VkDeviceMemory memory,
3104 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003105 deviceObject := GetDevice(device)
3106 bufferObject := GetBuffer(buffer)
3107 assert(bufferObject.device == device)
3108
3109 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003110 if bufferObject.memory != NULL_HANDLE {
3111 memoryObject := GetDeviceMemory(bufferObject.memory)
3112 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003113 }
3114
3115 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003116 if memory != NULL_HANDLE {
3117 memoryObject := GetDeviceMemory(memory)
3118 assert(memoryObject.device == device)
3119 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003120 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003121 bufferObject.memory = memory
3122 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003123
3124 return ?
3125}
3126
Jesse Hall606a54e2015-11-19 22:17:28 -08003127cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003128 VkDevice device,
3129 VkImage image,
3130 VkMemoryRequirements* pMemoryRequirements) {
3131 deviceObject := GetDevice(device)
3132 imageObject := GetImage(image)
3133 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003134}
3135
3136cmd VkResult vkBindImageMemory(
3137 VkDevice device,
3138 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003139 VkDeviceMemory memory,
3140 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003141 deviceObject := GetDevice(device)
3142 imageObject := GetImage(image)
3143 assert(imageObject.device == device)
3144
3145 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003146 if imageObject.memory != NULL_HANDLE {
3147 memoryObject := GetDeviceMemory(imageObject.memory)
3148 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003149 }
3150
3151 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003152 if memory != NULL_HANDLE {
3153 memoryObject := GetDeviceMemory(memory)
3154 assert(memoryObject.device == device)
3155 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003156 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003157 imageObject.memory = memory
3158 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003159
3160 return ?
3161}
3162
Jesse Hall606a54e2015-11-19 22:17:28 -08003163cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003164 VkDevice device,
3165 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003166 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003167 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3168 deviceObject := GetDevice(device)
3169 imageObject := GetImage(image)
3170 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003171}
3172
Jesse Hall606a54e2015-11-19 22:17:28 -08003173cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003174 VkPhysicalDevice physicalDevice,
3175 VkFormat format,
3176 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003177 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003178 VkImageUsageFlags usage,
3179 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003180 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003181 VkSparseImageFormatProperties* pProperties) {
3182 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003183}
3184
Jesse Halla6429252015-11-29 18:59:42 -08003185cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003186 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003187 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003188 const VkBindSparseInfo* pBindInfo,
3189 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003190 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003191
3192 return ?
3193}
3194
3195
3196// Fence functions
3197
3198@threadSafety("system")
3199cmd VkResult vkCreateFence(
3200 VkDevice device,
3201 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003202 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003203 VkFence* pFence) {
3204 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3205 deviceObject := GetDevice(device)
3206
3207 fence := ?
3208 pFence[0] = fence
3209 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003210 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003211
3212 return ?
3213}
3214
3215@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003216cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003217 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003218 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003219 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003220 deviceObject := GetDevice(device)
3221 fenceObject := GetFence(fence)
3222 assert(fenceObject.device == device)
3223
3224 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003225}
3226
3227@threadSafety("system")
3228cmd VkResult vkResetFences(
3229 VkDevice device,
3230 u32 fenceCount,
3231 const VkFence* pFences) {
3232 deviceObject := GetDevice(device)
3233
3234 fences := pFences[0:fenceCount]
3235 for i in (0 .. fenceCount) {
3236 fence := fences[i]
3237 fenceObject := GetFence(fence)
3238 assert(fenceObject.device == device)
3239 fenceObject.signaled = false
3240 }
3241
3242 return ?
3243}
3244
3245@threadSafety("system")
3246cmd VkResult vkGetFenceStatus(
3247 VkDevice device,
3248 VkFence fence) {
3249 deviceObject := GetDevice(device)
3250 fenceObject := GetFence(fence)
3251 assert(fenceObject.device == device)
3252
3253 return ?
3254}
3255
3256@threadSafety("system")
3257cmd VkResult vkWaitForFences(
3258 VkDevice device,
3259 u32 fenceCount,
3260 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003261 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003262 u64 timeout) { /// timeout in nanoseconds
3263 deviceObject := GetDevice(device)
3264
3265 fences := pFences[0:fenceCount]
3266 for i in (0 .. fenceCount) {
3267 fence := fences[i]
3268 fenceObject := GetFence(fence)
3269 assert(fenceObject.device == device)
3270 }
3271
3272 return ?
3273}
3274
3275
3276// Queue semaphore functions
3277
3278@threadSafety("system")
3279cmd VkResult vkCreateSemaphore(
3280 VkDevice device,
3281 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003282 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003283 VkSemaphore* pSemaphore) {
3284 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3285 deviceObject := GetDevice(device)
3286
3287 semaphore := ?
3288 pSemaphore[0] = semaphore
3289 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3290
3291 return ?
3292}
3293
3294@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003295cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003296 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003297 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003298 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003299 deviceObject := GetDevice(device)
3300 semaphoreObject := GetSemaphore(semaphore)
3301 assert(semaphoreObject.device == device)
3302
3303 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003304}
3305
Jesse Halld27f6aa2015-08-15 17:58:48 -07003306
3307// Event functions
3308
3309@threadSafety("system")
3310cmd VkResult vkCreateEvent(
3311 VkDevice device,
3312 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003313 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003314 VkEvent* pEvent) {
3315 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3316 deviceObject := GetDevice(device)
3317
3318 event := ?
3319 pEvent[0] = event
3320 State.Events[event] = new!EventObject(device: device)
3321
3322 return ?
3323}
3324
3325@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003326cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003327 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003328 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003329 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003330 deviceObject := GetDevice(device)
3331 eventObject := GetEvent(event)
3332 assert(eventObject.device == device)
3333
3334 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003335}
3336
3337@threadSafety("system")
3338cmd VkResult vkGetEventStatus(
3339 VkDevice device,
3340 VkEvent event) {
3341 deviceObject := GetDevice(device)
3342 eventObject := GetEvent(event)
3343 assert(eventObject.device == device)
3344
3345 return ?
3346}
3347
3348@threadSafety("system")
3349cmd VkResult vkSetEvent(
3350 VkDevice device,
3351 VkEvent event) {
3352 deviceObject := GetDevice(device)
3353 eventObject := GetEvent(event)
3354 assert(eventObject.device == device)
3355
3356 return ?
3357}
3358
3359@threadSafety("system")
3360cmd VkResult vkResetEvent(
3361 VkDevice device,
3362 VkEvent event) {
3363 deviceObject := GetDevice(device)
3364 eventObject := GetEvent(event)
3365 assert(eventObject.device == device)
3366
3367 return ?
3368}
3369
3370
3371// Query functions
3372
3373@threadSafety("system")
3374cmd VkResult vkCreateQueryPool(
3375 VkDevice device,
3376 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003377 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003378 VkQueryPool* pQueryPool) {
3379 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3380 deviceObject := GetDevice(device)
3381
3382 queryPool := ?
3383 pQueryPool[0] = queryPool
3384 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3385
3386 return ?
3387}
3388
3389@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003390cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003391 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003392 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003393 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003394 deviceObject := GetDevice(device)
3395 queryPoolObject := GetQueryPool(queryPool)
3396 assert(queryPoolObject.device == device)
3397
3398 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003399}
3400
3401@threadSafety("system")
3402cmd VkResult vkGetQueryPoolResults(
3403 VkDevice device,
3404 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003405 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003406 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003407 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003408 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003409 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003410 VkQueryResultFlags flags) {
3411 deviceObject := GetDevice(device)
3412 queryPoolObject := GetQueryPool(queryPool)
3413 assert(queryPoolObject.device == device)
3414
Jesse Halld27f6aa2015-08-15 17:58:48 -07003415 data := pData[0:dataSize]
3416
3417 return ?
3418}
3419
3420// Buffer functions
3421
3422@threadSafety("system")
3423cmd VkResult vkCreateBuffer(
3424 VkDevice device,
3425 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003426 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003427 VkBuffer* pBuffer) {
3428 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3429 deviceObject := GetDevice(device)
3430
3431 buffer := ?
3432 pBuffer[0] = buffer
3433 State.Buffers[buffer] = new!BufferObject(device: device)
3434
3435 return ?
3436}
3437
3438@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003439cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003440 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003441 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003442 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003443 deviceObject := GetDevice(device)
3444 bufferObject := GetBuffer(buffer)
3445 assert(bufferObject.device == device)
3446
Jesse Hall3fbc8562015-11-29 22:10:52 -08003447 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003448 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003449}
3450
3451
3452// Buffer view functions
3453
3454@threadSafety("system")
3455cmd VkResult vkCreateBufferView(
3456 VkDevice device,
3457 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003458 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003459 VkBufferView* pView) {
3460 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3461 deviceObject := GetDevice(device)
3462
3463 bufferObject := GetBuffer(pCreateInfo.buffer)
3464 assert(bufferObject.device == device)
3465
3466 view := ?
3467 pView[0] = view
3468 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3469
3470 return ?
3471}
3472
3473@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003474cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003475 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003476 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003477 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003478 deviceObject := GetDevice(device)
3479 bufferViewObject := GetBufferView(bufferView)
3480 assert(bufferViewObject.device == device)
3481
3482 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003483}
3484
3485
3486// Image functions
3487
3488@threadSafety("system")
3489cmd VkResult vkCreateImage(
3490 VkDevice device,
3491 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003492 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003493 VkImage* pImage) {
3494 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3495 deviceObject := GetDevice(device)
3496
3497 image := ?
3498 pImage[0] = image
3499 State.Images[image] = new!ImageObject(device: device)
3500
3501 return ?
3502}
3503
3504@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003505cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003506 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003507 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003508 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003509 deviceObject := GetDevice(device)
3510 imageObject := GetImage(image)
3511 assert(imageObject.device == device)
3512
Jesse Hall3fbc8562015-11-29 22:10:52 -08003513 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003514 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003515}
3516
Jesse Hall606a54e2015-11-19 22:17:28 -08003517cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003518 VkDevice device,
3519 VkImage image,
3520 const VkImageSubresource* pSubresource,
3521 VkSubresourceLayout* pLayout) {
3522 deviceObject := GetDevice(device)
3523 imageObject := GetImage(image)
3524 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003525}
3526
3527
3528// Image view functions
3529
3530@threadSafety("system")
3531cmd VkResult vkCreateImageView(
3532 VkDevice device,
3533 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003534 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003535 VkImageView* pView) {
3536 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
3537 deviceObject := GetDevice(device)
3538
3539 imageObject := GetImage(pCreateInfo.image)
3540 assert(imageObject.device == device)
3541
3542 view := ?
3543 pView[0] = view
3544 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
3545
3546 return ?
3547}
3548
3549@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003550cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003551 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003552 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003553 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003554 deviceObject := GetDevice(device)
3555 imageViewObject := GetImageView(imageView)
3556 assert(imageViewObject.device == device)
3557
3558 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003559}
3560
3561
3562// Shader functions
3563
3564cmd VkResult vkCreateShaderModule(
3565 VkDevice device,
3566 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003567 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003568 VkShaderModule* pShaderModule) {
3569 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
3570 deviceObject := GetDevice(device)
3571
3572 shaderModule := ?
3573 pShaderModule[0] = shaderModule
3574 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
3575
3576 return ?
3577}
3578
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003579cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003580 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003581 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003582 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003583 deviceObject := GetDevice(device)
3584 shaderModuleObject := GetShaderModule(shaderModule)
3585 assert(shaderModuleObject.device == device)
3586
3587 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003588}
3589
Jesse Halld27f6aa2015-08-15 17:58:48 -07003590
3591// Pipeline functions
3592
3593cmd VkResult vkCreatePipelineCache(
3594 VkDevice device,
3595 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003596 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003597 VkPipelineCache* pPipelineCache) {
3598 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
3599 deviceObject := GetDevice(device)
3600
3601 pipelineCache := ?
3602 pPipelineCache[0] = pipelineCache
3603 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
3604
3605 return ?
3606}
3607
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003608cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003609 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003610 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003611 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003612 deviceObject := GetDevice(device)
3613 pipelineCacheObject := GetPipelineCache(pipelineCache)
3614 assert(pipelineCacheObject.device == device)
3615
3616 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003617}
3618
Jesse Halld27f6aa2015-08-15 17:58:48 -07003619cmd VkResult vkGetPipelineCacheData(
3620 VkDevice device,
3621 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003622 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003623 void* pData) {
3624 deviceObject := GetDevice(device)
3625 pipelineCacheObject := GetPipelineCache(pipelineCache)
3626 assert(pipelineCacheObject.device == device)
3627
3628 return ?
3629}
3630
3631cmd VkResult vkMergePipelineCaches(
3632 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003633 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003634 u32 srcCacheCount,
3635 const VkPipelineCache* pSrcCaches) {
3636 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003637 dstCacheObject := GetPipelineCache(dstCache)
3638 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003639
3640 srcCaches := pSrcCaches[0:srcCacheCount]
3641 for i in (0 .. srcCacheCount) {
3642 srcCache := srcCaches[i]
3643 srcCacheObject := GetPipelineCache(srcCache)
3644 assert(srcCacheObject.device == device)
3645 }
3646
3647 return ?
3648}
3649
3650cmd VkResult vkCreateGraphicsPipelines(
3651 VkDevice device,
3652 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003653 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003654 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003655 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003656 VkPipeline* pPipelines) {
3657 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003658 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003659 pipelineCacheObject := GetPipelineCache(pipelineCache)
3660 assert(pipelineCacheObject.device == device)
3661 }
3662
Jesse Hall03b6fe12015-11-24 12:44:21 -08003663 createInfos := pCreateInfos[0:createInfoCount]
3664 pipelines := pPipelines[0:createInfoCount]
3665 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003666 pipeline := ?
3667 pipelines[i] = pipeline
3668 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3669 }
3670
3671 return ?
3672}
3673
3674cmd VkResult vkCreateComputePipelines(
3675 VkDevice device,
3676 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003677 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003678 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003679 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003680 VkPipeline* pPipelines) {
3681 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003682 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003683 pipelineCacheObject := GetPipelineCache(pipelineCache)
3684 assert(pipelineCacheObject.device == device)
3685 }
3686
Jesse Hall03b6fe12015-11-24 12:44:21 -08003687 createInfos := pCreateInfos[0:createInfoCount]
3688 pipelines := pPipelines[0:createInfoCount]
3689 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003690 pipeline := ?
3691 pipelines[i] = pipeline
3692 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3693 }
3694
3695 return ?
3696}
3697
3698@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003699cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003700 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003701 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003702 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003703 deviceObject := GetDevice(device)
3704 pipelineObjects := GetPipeline(pipeline)
3705 assert(pipelineObjects.device == device)
3706
3707 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003708}
3709
3710
3711// Pipeline layout functions
3712
3713@threadSafety("system")
3714cmd VkResult vkCreatePipelineLayout(
3715 VkDevice device,
3716 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003717 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003718 VkPipelineLayout* pPipelineLayout) {
3719 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
3720 deviceObject := GetDevice(device)
3721
3722 pipelineLayout := ?
3723 pPipelineLayout[0] = pipelineLayout
3724 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
3725
3726 return ?
3727}
3728
3729@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003730cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003731 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003732 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003733 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003734 deviceObject := GetDevice(device)
3735 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
3736 assert(pipelineLayoutObjects.device == device)
3737
3738 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003739}
3740
3741
3742// Sampler functions
3743
3744@threadSafety("system")
3745cmd VkResult vkCreateSampler(
3746 VkDevice device,
3747 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003748 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003749 VkSampler* pSampler) {
3750 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
3751 deviceObject := GetDevice(device)
3752
3753 sampler := ?
3754 pSampler[0] = sampler
3755 State.Samplers[sampler] = new!SamplerObject(device: device)
3756
3757 return ?
3758}
3759
3760@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003761cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003762 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003763 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003764 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003765 deviceObject := GetDevice(device)
3766 samplerObject := GetSampler(sampler)
3767 assert(samplerObject.device == device)
3768
3769 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003770}
3771
3772
3773// Descriptor set functions
3774
3775@threadSafety("system")
3776cmd VkResult vkCreateDescriptorSetLayout(
3777 VkDevice device,
3778 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003779 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780 VkDescriptorSetLayout* pSetLayout) {
3781 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
3782 deviceObject := GetDevice(device)
3783
3784 setLayout := ?
3785 pSetLayout[0] = setLayout
3786 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
3787
3788 return ?
3789}
3790
3791@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003792cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003793 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003794 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003795 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003796 deviceObject := GetDevice(device)
3797 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
3798 assert(descriptorSetLayoutObject.device == device)
3799
3800 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003801}
3802
3803@threadSafety("system")
3804cmd VkResult vkCreateDescriptorPool(
3805 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003806 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003807 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003808 VkDescriptorPool* pDescriptorPool) {
3809 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
3810 deviceObject := GetDevice(device)
3811
3812 descriptorPool := ?
3813 pDescriptorPool[0] = descriptorPool
3814 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
3815
3816 return ?
3817}
3818
3819@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003820cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003821 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003822 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003823 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003824 deviceObject := GetDevice(device)
3825 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3826 assert(descriptorPoolObject.device == device)
3827
3828 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003829}
3830
3831@threadSafety("app")
3832cmd VkResult vkResetDescriptorPool(
3833 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08003834 VkDescriptorPool descriptorPool,
3835 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003836 deviceObject := GetDevice(device)
3837 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3838 assert(descriptorPoolObject.device == device)
3839
3840 return ?
3841}
3842
3843@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003844cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003845 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003846 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003847 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003848 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003849 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003850 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003851
Jesse Hall03b6fe12015-11-24 12:44:21 -08003852 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
3853 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003854 setLayout := setLayouts[i]
3855 setLayoutObject := GetDescriptorSetLayout(setLayout)
3856 assert(setLayoutObject.device == device)
3857 }
3858
Jesse Hall03b6fe12015-11-24 12:44:21 -08003859 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
3860 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003861 descriptorSet := ?
3862 descriptorSets[i] = descriptorSet
3863 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
3864 }
3865
3866 return ?
3867}
3868
Jesse Hallf09c6b12015-08-15 19:54:28 -07003869cmd VkResult vkFreeDescriptorSets(
3870 VkDevice device,
3871 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003872 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07003873 const VkDescriptorSet* pDescriptorSets) {
3874 deviceObject := GetDevice(device)
3875 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3876
Jesse Hall03b6fe12015-11-24 12:44:21 -08003877 descriptorSets := pDescriptorSets[0:descriptorSetCount]
3878 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07003879 descriptorSet := descriptorSets[i]
3880 descriptorSetObject := GetDescriptorSet(descriptorSet)
3881 assert(descriptorSetObject.device == device)
3882 State.DescriptorSets[descriptorSet] = null
3883 }
3884
3885 return ?
3886}
3887
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003888cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003889 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08003890 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003891 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08003892 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003893 const VkCopyDescriptorSet* pDescriptorCopies) {
3894 deviceObject := GetDevice(device)
3895
Jesse Hallb00daad2015-11-29 19:46:20 -08003896 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
3897 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003898 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003899 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003900 assert(descriptorWriteObject.device == device)
3901 }
3902
Jesse Hallb00daad2015-11-29 19:46:20 -08003903 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
3904 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003905 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003906 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003907 assert(descriptorCopyObject.device == device)
3908 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003909}
3910
3911
3912// Framebuffer functions
3913
3914@threadSafety("system")
3915cmd VkResult vkCreateFramebuffer(
3916 VkDevice device,
3917 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003918 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003919 VkFramebuffer* pFramebuffer) {
3920 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
3921 deviceObject := GetDevice(device)
3922
3923 framebuffer := ?
3924 pFramebuffer[0] = framebuffer
3925 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
3926
3927 return ?
3928}
3929
3930@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003931cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003932 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003933 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003934 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003935 deviceObject := GetDevice(device)
3936 framebufferObject := GetFramebuffer(framebuffer)
3937 assert(framebufferObject.device == device)
3938
3939 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003940}
3941
3942
3943// Renderpass functions
3944
3945@threadSafety("system")
3946cmd VkResult vkCreateRenderPass(
3947 VkDevice device,
3948 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003949 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003950 VkRenderPass* pRenderPass) {
3951 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
3952 deviceObject := GetDevice(device)
3953
3954 renderpass := ?
3955 pRenderPass[0] = renderpass
3956 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
3957
3958 return ?
3959}
3960
3961@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003962cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003963 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003964 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003965 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003966 deviceObject := GetDevice(device)
3967 renderPassObject := GetRenderPass(renderPass)
3968 assert(renderPassObject.device == device)
3969
3970 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003971}
3972
Jesse Hall606a54e2015-11-19 22:17:28 -08003973cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003974 VkDevice device,
3975 VkRenderPass renderPass,
3976 VkExtent2D* pGranularity) {
3977 deviceObject := GetDevice(device)
3978 renderPassObject := GetRenderPass(renderPass)
3979
3980 granularity := ?
3981 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07003982}
3983
3984// Command pool functions
3985
3986cmd VkResult vkCreateCommandPool(
3987 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003988 const VkCommandPoolCreateInfo* pCreateInfo,
3989 const VkAllocationCallbacks* pAllocator,
3990 VkCommandPool* pCommandPool) {
3991 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003992 deviceObject := GetDevice(device)
3993
Jesse Hall3fbc8562015-11-29 22:10:52 -08003994 commandPool := ?
3995 pCommandPool[0] = commandPool
3996 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003997
3998 return ?
3999}
4000
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004001cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004002 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004003 VkCommandPool commandPool,
4004 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004005 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004006 commandPoolObject := GetCommandPool(commandPool)
4007 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004008
Jesse Hall3fbc8562015-11-29 22:10:52 -08004009 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004010}
4011
4012cmd VkResult vkResetCommandPool(
4013 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004014 VkCommandPool commandPool,
4015 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004016 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004017 commandPoolObject := GetCommandPool(commandPool)
4018 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004019
4020 return ?
4021}
4022
4023// Command buffer functions
4024
Jesse Hall3fbc8562015-11-29 22:10:52 -08004025macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4026 memoryObject := GetDeviceMemory(memory)
4027 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004028
Jesse Hall3fbc8562015-11-29 22:10:52 -08004029 commandBufferObject := GetCommandBuffer(commandBuffer)
4030 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004031}
4032
Jesse Hall3fbc8562015-11-29 22:10:52 -08004033macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4034 memoryObject := GetDeviceMemory(memory)
4035 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004036
Jesse Hall3fbc8562015-11-29 22:10:52 -08004037 commandBufferObject := GetCommandBuffer(commandBuffer)
4038 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004039}
4040
4041@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004042cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004043 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004044 const VkCommandBufferAllocateInfo* pAllocateInfo,
4045 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004046 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004047
Jesse Hall3dd678a2016-01-08 21:52:01 -08004048 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004049 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004050 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004051 commandBuffer := ?
4052 commandBuffers[i] = commandBuffer
4053 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004054 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004055
4056 return ?
4057}
4058
4059@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004060cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004061 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004062 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004063 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004064 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004065 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004066
Jesse Hall3fbc8562015-11-29 22:10:52 -08004067 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004068 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004069 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4070 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004071 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004072 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004073 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004074}
4075
4076@threadSafety("app")
4077cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004078 VkCommandBuffer commandBuffer,
4079 const VkCommandBufferBeginInfo* pBeginInfo) {
4080 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4081 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004082
4083 // TODO: iterate over boundObjects and clear memory bindings
4084
4085 return ?
4086}
4087
4088@threadSafety("app")
4089cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004090 VkCommandBuffer commandBuffer) {
4091 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004092
4093 return ?
4094}
4095
4096@threadSafety("app")
4097cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004098 VkCommandBuffer commandBuffer,
4099 VkCommandBufferResetFlags flags) {
4100 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004101
4102 // TODO: iterate over boundObjects and clear memory bindings
4103
4104 return ?
4105}
4106
4107
4108// Command buffer building functions
4109
4110@threadSafety("app")
4111cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004112 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004113 VkPipelineBindPoint pipelineBindPoint,
4114 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004115 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004116 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004117 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004118
Jesse Halld8bade02015-11-24 10:24:18 -08004119 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004120 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4121 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4122 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004123 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004124}
4125
4126@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004127cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004128 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004129 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004130 u32 viewportCount,
4131 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004132 commandBufferObject := GetCommandBuffer(commandBuffer)
4133 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004134}
4135
4136@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004137cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004138 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004139 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004140 u32 scissorCount,
4141 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004142 commandBufferObject := GetCommandBuffer(commandBuffer)
4143 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004144}
4145
4146@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004147cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004148 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004149 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004150 commandBufferObject := GetCommandBuffer(commandBuffer)
4151 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004152}
4153
4154@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004155cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004156 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004157 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004158 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004159 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004160 commandBufferObject := GetCommandBuffer(commandBuffer)
4161 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004162}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004163
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004164@threadSafety("app")
4165cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004166 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004167 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4168 // an annotation as a quick hack to pass this to the template without
4169 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004170 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004171 commandBufferObject := GetCommandBuffer(commandBuffer)
4172 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004173}
4174
4175@threadSafety("app")
4176cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004177 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004178 f32 minDepthBounds,
4179 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004180 commandBufferObject := GetCommandBuffer(commandBuffer)
4181 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004182}
4183
4184@threadSafety("app")
4185cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004186 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004187 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004188 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004189 commandBufferObject := GetCommandBuffer(commandBuffer)
4190 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004191}
4192
4193@threadSafety("app")
4194cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004195 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004196 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004197 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004198 commandBufferObject := GetCommandBuffer(commandBuffer)
4199 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004200}
4201
4202@threadSafety("app")
4203cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004204 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004205 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004206 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004207 commandBufferObject := GetCommandBuffer(commandBuffer)
4208 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004209}
4210
4211@threadSafety("app")
4212cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004213 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004214 VkPipelineBindPoint pipelineBindPoint,
4215 VkPipelineLayout layout,
4216 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004217 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004218 const VkDescriptorSet* pDescriptorSets,
4219 u32 dynamicOffsetCount,
4220 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004221 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004222
Jesse Hall03b6fe12015-11-24 12:44:21 -08004223 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4224 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004225 descriptorSet := descriptorSets[i]
4226 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004227 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004228 }
4229
4230 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4231 for i in (0 .. dynamicOffsetCount) {
4232 dynamicOffset := dynamicOffsets[i]
4233 }
4234
Jesse Halld8bade02015-11-24 10:24:18 -08004235 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004236 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4237 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4238 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004239 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004240}
4241
4242@threadSafety("app")
4243cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004244 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004245 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004246 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004247 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004248 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004249 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004250 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004251
Jesse Hall3fbc8562015-11-29 22:10:52 -08004252 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004253
Jesse Hall3fbc8562015-11-29 22:10:52 -08004254 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004255}
4256
4257@threadSafety("app")
4258cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004259 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004260 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004261 u32 bindingCount,
4262 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004263 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004264 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004265
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004266 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004267 buffers := pBuffers[0:bindingCount]
4268 offsets := pOffsets[0:bindingCount]
4269 for i in (0 .. bindingCount) {
4270 buffer := buffers[i]
4271 offset := offsets[i]
4272 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004273 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004274
Jesse Hall3fbc8562015-11-29 22:10:52 -08004275 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004276 }
4277
Jesse Hall3fbc8562015-11-29 22:10:52 -08004278 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004279}
4280
4281@threadSafety("app")
4282cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004283 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004284 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004285 u32 instanceCount,
4286 u32 firstVertex,
4287 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004288 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004289
Jesse Hall3fbc8562015-11-29 22:10:52 -08004290 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004291}
4292
4293@threadSafety("app")
4294cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004295 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004296 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004297 u32 instanceCount,
4298 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004300 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004301 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004302
Jesse Hall3fbc8562015-11-29 22:10:52 -08004303 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004304}
4305
4306@threadSafety("app")
4307cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004308 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004309 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004310 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004311 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004312 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004313 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004314 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004315 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004316
Jesse Hall3fbc8562015-11-29 22:10:52 -08004317 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004318
Jesse Hall3fbc8562015-11-29 22:10:52 -08004319 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004320}
4321
4322@threadSafety("app")
4323cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004324 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004325 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004326 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004327 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004328 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004329 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004330 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004331 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004332
Jesse Hall3fbc8562015-11-29 22:10:52 -08004333 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004334
Jesse Hall3fbc8562015-11-29 22:10:52 -08004335 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004336}
4337
4338@threadSafety("app")
4339cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004340 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004341 u32 x,
4342 u32 y,
4343 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004344 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004345
Jesse Hall3fbc8562015-11-29 22:10:52 -08004346 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004347}
4348
4349@threadSafety("app")
4350cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004351 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004352 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004353 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004354 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004355 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004356 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004357
Jesse Hall3fbc8562015-11-29 22:10:52 -08004358 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004359
Jesse Hall3fbc8562015-11-29 22:10:52 -08004360 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004361}
4362
4363@threadSafety("app")
4364cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004365 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004366 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004367 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004368 u32 regionCount,
4369 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004370 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004371 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004372 dstBufferObject := GetBuffer(dstBuffer)
4373 assert(commandBufferObject.device == srcBufferObject.device)
4374 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004375
4376 regions := pRegions[0:regionCount]
4377 for i in (0 .. regionCount) {
4378 region := regions[i]
4379 }
4380
Jesse Hall3fbc8562015-11-29 22:10:52 -08004381 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4382 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004383
Jesse Hall65ab5522015-11-30 00:07:16 -08004384 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004385}
4386
4387@threadSafety("app")
4388cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004389 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004390 VkImage srcImage,
4391 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004392 VkImage dstImage,
4393 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004394 u32 regionCount,
4395 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004396 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004397 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004398 dstImageObject := GetImage(dstImage)
4399 assert(commandBufferObject.device == srcImageObject.device)
4400 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004401
4402 regions := pRegions[0:regionCount]
4403 for i in (0 .. regionCount) {
4404 region := regions[i]
4405 }
4406
Jesse Hall3fbc8562015-11-29 22:10:52 -08004407 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4408 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004409
Jesse Hall65ab5522015-11-30 00:07:16 -08004410 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004411}
4412
4413@threadSafety("app")
4414cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004415 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004416 VkImage srcImage,
4417 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004418 VkImage dstImage,
4419 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004420 u32 regionCount,
4421 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004422 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004423 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004424 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004425 dstImageObject := GetImage(dstImage)
4426 assert(commandBufferObject.device == srcImageObject.device)
4427 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004428
4429 regions := pRegions[0:regionCount]
4430 for i in (0 .. regionCount) {
4431 region := regions[i]
4432 }
4433
Jesse Hall3fbc8562015-11-29 22:10:52 -08004434 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4435 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004436
Jesse Hall3fbc8562015-11-29 22:10:52 -08004437 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004438}
4439
4440@threadSafety("app")
4441cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004442 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004443 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004444 VkImage dstImage,
4445 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004446 u32 regionCount,
4447 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004448 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004449 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004450 dstImageObject := GetImage(dstImage)
4451 assert(commandBufferObject.device == srcBufferObject.device)
4452 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004453
4454 regions := pRegions[0:regionCount]
4455 for i in (0 .. regionCount) {
4456 region := regions[i]
4457 }
4458
Jesse Hall3fbc8562015-11-29 22:10:52 -08004459 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4460 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004461
Jesse Hall65ab5522015-11-30 00:07:16 -08004462 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004463}
4464
4465@threadSafety("app")
4466cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004467 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004468 VkImage srcImage,
4469 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004470 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004471 u32 regionCount,
4472 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004473 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004474 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004475 dstBufferObject := GetBuffer(dstBuffer)
4476 assert(commandBufferObject.device == srcImageObject.device)
4477 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004478
4479 regions := pRegions[0:regionCount]
4480 for i in (0 .. regionCount) {
4481 region := regions[i]
4482 }
4483
Jesse Hall3fbc8562015-11-29 22:10:52 -08004484 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4485 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004486
Jesse Hall65ab5522015-11-30 00:07:16 -08004487 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488}
4489
4490@threadSafety("app")
4491cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004492 VkCommandBuffer commandBuffer,
4493 VkBuffer dstBuffer,
4494 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004495 VkDeviceSize dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004496 const u32* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004497 commandBufferObject := GetCommandBuffer(commandBuffer)
4498 dstBufferObject := GetBuffer(dstBuffer)
4499 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004500
4501 data := pData[0:dataSize]
4502
Jesse Hall3fbc8562015-11-29 22:10:52 -08004503 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004504
Jesse Hall65ab5522015-11-30 00:07:16 -08004505 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004506}
4507
4508@threadSafety("app")
4509cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004510 VkCommandBuffer commandBuffer,
4511 VkBuffer dstBuffer,
4512 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004513 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004514 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004515 commandBufferObject := GetCommandBuffer(commandBuffer)
4516 dstBufferObject := GetBuffer(dstBuffer)
4517 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004518
Jesse Hall65ab5522015-11-30 00:07:16 -08004519 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004520}
4521
4522@threadSafety("app")
4523cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004524 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004525 VkImage image,
4526 VkImageLayout imageLayout,
4527 const VkClearColorValue* pColor,
4528 u32 rangeCount,
4529 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004530 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004531 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004532 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004533
4534 ranges := pRanges[0:rangeCount]
4535 for i in (0 .. rangeCount) {
4536 range := ranges[i]
4537 }
4538
Jesse Hall3fbc8562015-11-29 22:10:52 -08004539 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004540
Jesse Hall3fbc8562015-11-29 22:10:52 -08004541 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004542}
4543
4544@threadSafety("app")
4545cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004546 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004547 VkImage image,
4548 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004549 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004550 u32 rangeCount,
4551 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004552 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004553 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004554 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004555
4556 ranges := pRanges[0:rangeCount]
4557 for i in (0 .. rangeCount) {
4558 range := ranges[i]
4559 }
4560
Jesse Hall3fbc8562015-11-29 22:10:52 -08004561 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004562
Jesse Hall3fbc8562015-11-29 22:10:52 -08004563 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004564}
4565
4566@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08004567cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004568 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08004569 u32 attachmentCount,
4570 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004571 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08004572 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004573 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004574
4575 rects := pRects[0:rectCount]
4576 for i in (0 .. rectCount) {
4577 rect := rects[i]
4578 }
4579
Jesse Hall3fbc8562015-11-29 22:10:52 -08004580 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004581}
4582
4583@threadSafety("app")
4584cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004585 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004586 VkImage srcImage,
4587 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004588 VkImage dstImage,
4589 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004590 u32 regionCount,
4591 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004592 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004593 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004594 dstImageObject := GetImage(dstImage)
4595 assert(commandBufferObject.device == srcImageObject.device)
4596 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004597
4598 regions := pRegions[0:regionCount]
4599 for i in (0 .. regionCount) {
4600 region := regions[i]
4601 }
4602
Jesse Hall3fbc8562015-11-29 22:10:52 -08004603 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4604 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004605
Jesse Hall3fbc8562015-11-29 22:10:52 -08004606 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004607}
4608
4609@threadSafety("app")
4610cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004611 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004612 VkEvent event,
4613 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004614 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004615 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004616 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004617}
4618
4619@threadSafety("app")
4620cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004621 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004622 VkEvent event,
4623 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004624 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004625 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004626 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004627}
4628
4629@threadSafety("app")
4630cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004631 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004632 u32 eventCount,
4633 const VkEvent* pEvents,
4634 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004635 VkPipelineStageFlags dstStageMask,
4636 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004637 const VkMemoryBarrier* pMemoryBarriers,
4638 u32 bufferMemoryBarrierCount,
4639 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4640 u32 imageMemoryBarrierCount,
4641 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004642 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004643
4644 events := pEvents[0:eventCount]
4645 for i in (0 .. eventCount) {
4646 event := events[i]
4647 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004648 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004649 }
4650
Jesse Hall3dd678a2016-01-08 21:52:01 -08004651 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004652 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004653 memoryBarrier := memoryBarriers[i]
4654 }
4655 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4656 for i in (0 .. bufferMemoryBarrierCount) {
4657 bufferMemoryBarrier := bufferMemoryBarriers[i]
4658 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4659 assert(bufferObject.device == commandBufferObject.device)
4660 }
4661 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4662 for i in (0 .. imageMemoryBarrierCount) {
4663 imageMemoryBarrier := imageMemoryBarriers[i]
4664 imageObject := GetImage(imageMemoryBarrier.image)
4665 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004666 }
4667}
4668
4669@threadSafety("app")
4670cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004671 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004672 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004673 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08004674 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004675 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004676 const VkMemoryBarrier* pMemoryBarriers,
4677 u32 bufferMemoryBarrierCount,
4678 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4679 u32 imageMemoryBarrierCount,
4680 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004681 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004682
Jesse Hall3dd678a2016-01-08 21:52:01 -08004683 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004684 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004685 memoryBarrier := memoryBarriers[i]
4686 }
4687 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4688 for i in (0 .. bufferMemoryBarrierCount) {
4689 bufferMemoryBarrier := bufferMemoryBarriers[i]
4690 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4691 assert(bufferObject.device == commandBufferObject.device)
4692 }
4693 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4694 for i in (0 .. imageMemoryBarrierCount) {
4695 imageMemoryBarrier := imageMemoryBarriers[i]
4696 imageObject := GetImage(imageMemoryBarrier.image)
4697 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004698 }
4699}
4700
4701@threadSafety("app")
4702cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004703 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004704 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004705 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004706 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004707 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004708 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004709 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004710}
4711
4712@threadSafety("app")
4713cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004714 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004715 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004716 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004717 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004718 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004719 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004720}
4721
4722@threadSafety("app")
4723cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004724 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004725 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004726 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004727 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004728 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004729 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004730 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004731}
4732
4733@threadSafety("app")
4734cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004735 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08004736 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004737 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004738 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004739 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004740 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004741 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004742}
4743
4744@threadSafety("app")
4745cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004746 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004747 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004748 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004749 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004750 VkBuffer dstBuffer,
4751 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004752 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004753 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004754 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004755 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004756 dstBufferObject := GetBuffer(dstBuffer)
4757 assert(commandBufferObject.device == queryPoolObject.device)
4758 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004759}
4760
4761cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004762 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004763 VkPipelineLayout layout,
4764 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004765 u32 offset,
4766 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004767 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004768 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004769 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004770 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004771}
4772
4773@threadSafety("app")
4774cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004775 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004776 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08004777 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004778 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004779 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
4780 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004781 assert(commandBufferObject.device == renderPassObject.device)
4782 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004783
Jesse Hall3fbc8562015-11-29 22:10:52 -08004784 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004785}
4786
4787cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004788 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08004789 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004790 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004791}
4792
4793@threadSafety("app")
4794cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004795 VkCommandBuffer commandBuffer) {
4796 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004797
Jesse Hall3fbc8562015-11-29 22:10:52 -08004798 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004799}
4800
4801cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004802 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004803 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004804 const VkCommandBuffer* pCommandBuffers) {
4805 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004806
Jesse Hall3dd678a2016-01-08 21:52:01 -08004807 commandBuffers := pCommandBuffers[0:commandBufferCount]
4808 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004809 secondaryCommandBuffer := commandBuffers[i]
4810 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
4811 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004812 }
4813}
4814
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004815@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004816cmd void vkDestroySurfaceKHR(
4817 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08004818 VkSurfaceKHR surface,
4819 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004820 instanceObject := GetInstance(instance)
4821 surfaceObject := GetSurface(surface)
4822 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08004823
Jesse Hall1356b0d2015-11-23 17:24:58 -08004824 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08004825}
4826
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004827@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004828cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004829 VkPhysicalDevice physicalDevice,
4830 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004831 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08004832 VkBool32* pSupported) {
4833 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004834
4835 return ?
4836}
4837
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004838@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004839cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
4840 VkPhysicalDevice physicalDevice,
4841 VkSurfaceKHR surface,
4842 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
4843 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4844
4845 surfaceCapabilities := ?
4846 pSurfaceCapabilities[0] = surfaceCapabilities
4847
4848 return ?
4849}
4850
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004851@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004852cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
4853 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004854 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004855 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004856 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004857 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004858
4859 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004860 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004861 surfaceFormats := pSurfaceFormats[0:count]
4862
4863 for i in (0 .. count) {
4864 surfaceFormat := ?
4865 surfaceFormats[i] = surfaceFormat
4866 }
4867
4868 return ?
4869}
4870
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004871@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004872cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
4873 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004874 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004875 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004876 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004877 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004878
4879 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004880 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004881 presentModes := pPresentModes[0:count]
4882
4883 for i in (0 .. count) {
4884 presentMode := ?
4885 presentModes[i] = presentMode
4886 }
4887
4888 return ?
4889}
4890
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004891@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004892cmd VkResult vkCreateSwapchainKHR(
4893 VkDevice device,
4894 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004895 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08004896 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004897 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08004898 deviceObject := GetDevice(device)
4899
4900 swapchain := ?
4901 pSwapchain[0] = swapchain
4902 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
4903
4904 return ?
4905}
4906
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004907@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004908cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08004909 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08004910 VkSwapchainKHR swapchain,
4911 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08004912 deviceObject := GetDevice(device)
4913 swapchainObject := GetSwapchain(swapchain)
4914 assert(swapchainObject.device == device)
4915
4916 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08004917}
4918
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004919@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004920cmd VkResult vkGetSwapchainImagesKHR(
4921 VkDevice device,
4922 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004923 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08004924 VkImage* pSwapchainImages) {
4925 deviceObject := GetDevice(device)
4926
4927 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004928 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004929 swapchainImages := pSwapchainImages[0:count]
4930
4931 for i in (0 .. count) {
4932 swapchainImage := ?
4933 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08004934 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08004935 }
4936
4937 return ?
4938}
4939
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004940@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004941cmd VkResult vkAcquireNextImageKHR(
4942 VkDevice device,
4943 VkSwapchainKHR swapchain,
4944 u64 timeout,
4945 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004946 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08004947 u32* pImageIndex) {
4948 deviceObject := GetDevice(device)
4949 swapchainObject := GetSwapchain(swapchain)
4950
4951 imageIndex := ?
4952 pImageIndex[0] = imageIndex
4953
4954 return ?
4955}
4956
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004957@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004958cmd VkResult vkQueuePresentKHR(
4959 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004960 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08004961 queueObject := GetQueue(queue)
4962
4963 presentInfo := ?
4964 pPresentInfo[0] = presentInfo
4965
4966 return ?
4967}
4968
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004969@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004970cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
4971 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004972 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004973 VkDisplayPropertiesKHR* pProperties) {
4974 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4975 return ?
4976}
4977
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004978@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004979cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
4980 VkPhysicalDevice physicalDevice,
4981 u32* pPropertyCount,
4982 VkDisplayPlanePropertiesKHR* pProperties) {
4983 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4984 return ?
4985}
4986
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004987@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004988cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
4989 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004990 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004991 u32* pDisplayCount,
4992 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08004993 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4994 return ?
4995}
4996
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004997@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004998cmd VkResult vkGetDisplayModePropertiesKHR(
4999 VkPhysicalDevice physicalDevice,
5000 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005001 u32* pPropertyCount,
5002 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005003 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5004 return ?
5005}
5006
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005007@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005008cmd VkResult vkCreateDisplayModeKHR(
5009 VkPhysicalDevice physicalDevice,
5010 VkDisplayKHR display,
5011 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005012 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005013 VkDisplayModeKHR* pMode) {
5014 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5015 return ?
5016}
5017
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005018@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005019cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005020 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005021 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005022 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005023 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005024 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5025 return ?
5026}
5027
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005028@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005029cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5030 VkInstance instance,
5031 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005032 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005033 VkSurfaceKHR* pSurface) {
5034 return ?
5035}
5036
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005037@extension("VK_KHR_display_swapchain")
5038cmd VkResult vkCreateSharedSwapchainsKHR(
5039 VkDevice device,
5040 u32 swapchainCount,
5041 const VkSwapchainCreateInfoKHR* pCreateInfos,
5042 const VkAllocationCallbacks* pAllocator,
5043 VkSwapchainKHR* pSwapchains) {
5044 return ?
5045}
5046
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005047@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005048cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005049 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005050 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005051 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005052 VkSurfaceKHR* pSurface) {
5053 instanceObject := GetInstance(instance)
5054 return ?
5055}
5056
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005057@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005058cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5059 VkPhysicalDevice physicalDevice,
5060 u32 queueFamilyIndex,
5061 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005062 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005063 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5064 return ?
5065}
5066
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005067@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005068cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005069 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005070 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005071 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005072 VkSurfaceKHR* pSurface) {
5073 instanceObject := GetInstance(instance)
5074 return ?
5075}
5076
Jesse Hall523db342015-11-30 21:12:55 -08005077@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005078cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5079 VkPhysicalDevice physicalDevice,
5080 u32 queueFamilyIndex,
5081 platform.xcb_connection_t* connection,
5082 platform.xcb_visualid_t visual_id) {
5083 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5084 return ?
5085}
5086
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005087@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005088cmd VkResult vkCreateWaylandSurfaceKHR(
5089 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005090 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005091 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005092 VkSurfaceKHR* pSurface) {
5093 instanceObject := GetInstance(instance)
5094 return ?
5095}
5096
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005097@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005098cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5099 VkPhysicalDevice physicalDevice,
5100 u32 queueFamilyIndex,
5101 platform.wl_display* display) {
5102 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5103 return ?
5104}
5105
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005106@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005107cmd VkResult vkCreateMirSurfaceKHR(
5108 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005109 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005110 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005111 VkSurfaceKHR* pSurface) {
5112 instanceObject := GetInstance(instance)
5113 return ?
5114}
5115
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005116@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005117cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5118 VkPhysicalDevice physicalDevice,
5119 u32 queueFamilyIndex,
5120 platform.MirConnection* connection) {
5121 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5122 return ?
5123}
5124
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005125@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005126cmd VkResult vkCreateAndroidSurfaceKHR(
5127 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005128 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005129 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005130 VkSurfaceKHR* pSurface) {
5131 instanceObject := GetInstance(instance)
5132 return ?
5133}
5134
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005135@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005136cmd VkResult vkCreateWin32SurfaceKHR(
5137 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005138 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005139 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005140 VkSurfaceKHR* pSurface) {
5141 instanceObject := GetInstance(instance)
5142 return ?
5143}
5144
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005145@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005146cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5147 VkPhysicalDevice physicalDevice,
5148 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005149 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005150 return ?
5151}
5152
Chia-I Wub262ddc2016-03-22 07:38:20 +08005153@extension("VK_ANDROID_native_buffer")
5154cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5155 VkDevice device,
5156 VkFormat format,
5157 VkImageUsageFlags imageUsage,
5158 int* grallocUsage) {
5159 return ?
5160}
5161
5162@extension("VK_ANDROID_native_buffer")
5163cmd VkResult vkAcquireImageANDROID(
5164 VkDevice device,
5165 VkImage image,
5166 int nativeFenceFd,
5167 VkSemaphore semaphore,
5168 VkFence fence) {
5169 return ?
5170}
5171
5172@extension("VK_ANDROID_native_buffer")
5173cmd VkResult vkQueueSignalReleaseImageANDROID(
5174 VkQueue queue,
5175 u32 waitSemaphoreCount,
5176 const VkSemaphore* pWaitSemaphores,
5177 VkImage image,
5178 int* pNativeFenceFd) {
5179 return ?
5180}
5181
Jesse Hall715b86a2016-01-16 16:34:29 -08005182@extension("VK_EXT_debug_report")
5183@external type void* PFN_vkDebugReportCallbackEXT
5184@extension("VK_EXT_debug_report")
5185@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5186 VkDebugReportFlagsEXT flags,
5187 VkDebugReportObjectTypeEXT objectType,
5188 u64 object,
5189 platform.size_t location,
5190 s32 messageCode,
5191 const char* pLayerPrefix,
5192 const char* pMessage,
5193 void* pUserData) {
5194 return ?
5195}
5196
5197@extension("VK_EXT_debug_report")
5198cmd VkResult vkCreateDebugReportCallbackEXT(
5199 VkInstance instance,
5200 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5201 const VkAllocationCallbacks* pAllocator,
5202 VkDebugReportCallbackEXT* pCallback) {
5203 return ?
5204}
5205
5206@extension("VK_EXT_debug_report")
5207cmd void vkDestroyDebugReportCallbackEXT(
5208 VkInstance instance,
5209 VkDebugReportCallbackEXT callback,
5210 const VkAllocationCallbacks* pAllocator) {
5211}
5212
5213@extension("VK_EXT_debug_report")
5214cmd void vkDebugReportMessageEXT(
5215 VkInstance instance,
5216 VkDebugReportFlagsEXT flags,
5217 VkDebugReportObjectTypeEXT objectType,
5218 u64 object,
5219 platform.size_t location,
5220 s32 messageCode,
5221 const char* pLayerPrefix,
5222 const char* pMessage) {
5223}
5224
Jesse Halld27f6aa2015-08-15 17:58:48 -07005225
5226////////////////
5227// Validation //
5228////////////////
5229
5230extern void validate(string layerName, bool condition, string message)
5231
5232
5233/////////////////////////////
5234// Internal State Tracking //
5235/////////////////////////////
5236
5237StateObject State
5238
5239@internal class StateObject {
5240 // Dispatchable objects.
5241 map!(VkInstance, ref!InstanceObject) Instances
5242 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5243 map!(VkDevice, ref!DeviceObject) Devices
5244 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005245 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005246
5247 // Non-dispatchable objects.
5248 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5249 map!(VkBuffer, ref!BufferObject) Buffers
5250 map!(VkBufferView, ref!BufferViewObject) BufferViews
5251 map!(VkImage, ref!ImageObject) Images
5252 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005253 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005254 map!(VkPipeline, ref!PipelineObject) Pipelines
5255 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5256 map!(VkSampler, ref!SamplerObject) Samplers
5257 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5258 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5259 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005260 map!(VkFence, ref!FenceObject) Fences
5261 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5262 map!(VkEvent, ref!EventObject) Events
5263 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5264 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5265 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5266 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005267 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005268 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005269 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005270}
5271
5272@internal class InstanceObject {
5273}
5274
5275@internal class PhysicalDeviceObject {
5276 VkInstance instance
5277}
5278
5279@internal class DeviceObject {
5280 VkPhysicalDevice physicalDevice
5281}
5282
5283@internal class QueueObject {
5284 VkDevice device
5285 VkQueueFlags flags
5286}
5287
Jesse Hall3fbc8562015-11-29 22:10:52 -08005288@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005289 VkDevice device
5290 map!(u64, VkDeviceMemory) boundObjects
5291 VkQueueFlags queueFlags
5292}
5293
5294@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005295 VkDevice device
5296 VkDeviceSize allocationSize
5297 map!(u64, VkDeviceSize) boundObjects
5298 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005299}
5300
5301@internal class BufferObject {
5302 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005303 VkDeviceMemory memory
5304 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005305}
5306
5307@internal class BufferViewObject {
5308 VkDevice device
5309 VkBuffer buffer
5310}
5311
5312@internal class ImageObject {
5313 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005314 VkDeviceMemory memory
5315 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005316}
5317
5318@internal class ImageViewObject {
5319 VkDevice device
5320 VkImage image
5321}
5322
Jesse Halld27f6aa2015-08-15 17:58:48 -07005323@internal class ShaderObject {
5324 VkDevice device
5325}
5326
5327@internal class ShaderModuleObject {
5328 VkDevice device
5329}
5330
5331@internal class PipelineObject {
5332 VkDevice device
5333}
5334
5335@internal class PipelineLayoutObject {
5336 VkDevice device
5337}
5338
5339@internal class SamplerObject {
5340 VkDevice device
5341}
5342
5343@internal class DescriptorSetObject {
5344 VkDevice device
5345}
5346
5347@internal class DescriptorSetLayoutObject {
5348 VkDevice device
5349}
5350
5351@internal class DescriptorPoolObject {
5352 VkDevice device
5353}
5354
Jesse Halld27f6aa2015-08-15 17:58:48 -07005355@internal class FenceObject {
5356 VkDevice device
5357 bool signaled
5358}
5359
5360@internal class SemaphoreObject {
5361 VkDevice device
5362}
5363
5364@internal class EventObject {
5365 VkDevice device
5366}
5367
5368@internal class QueryPoolObject {
5369 VkDevice device
5370}
5371
5372@internal class FramebufferObject {
5373 VkDevice device
5374}
5375
5376@internal class RenderPassObject {
5377 VkDevice device
5378}
5379
5380@internal class PipelineCacheObject {
5381 VkDevice device
5382}
5383
Jesse Hall3fbc8562015-11-29 22:10:52 -08005384@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005385 VkDevice device
5386}
5387
Jesse Hall1356b0d2015-11-23 17:24:58 -08005388@internal class SurfaceObject {
5389 VkInstance instance
5390}
5391
Michael Lentine88594d72015-11-12 12:49:45 -08005392@internal class SwapchainObject {
5393 VkDevice device
5394}
5395
Jesse Halld27f6aa2015-08-15 17:58:48 -07005396macro ref!InstanceObject GetInstance(VkInstance instance) {
5397 assert(instance in State.Instances)
5398 return State.Instances[instance]
5399}
5400
5401macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
5402 assert(physicalDevice in State.PhysicalDevices)
5403 return State.PhysicalDevices[physicalDevice]
5404}
5405
5406macro ref!DeviceObject GetDevice(VkDevice device) {
5407 assert(device in State.Devices)
5408 return State.Devices[device]
5409}
5410
5411macro ref!QueueObject GetQueue(VkQueue queue) {
5412 assert(queue in State.Queues)
5413 return State.Queues[queue]
5414}
5415
Jesse Hall3fbc8562015-11-29 22:10:52 -08005416macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
5417 assert(commandBuffer in State.CommandBuffers)
5418 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005419}
5420
Jesse Hall3fbc8562015-11-29 22:10:52 -08005421macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
5422 assert(memory in State.DeviceMemories)
5423 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005424}
5425
5426macro ref!BufferObject GetBuffer(VkBuffer buffer) {
5427 assert(buffer in State.Buffers)
5428 return State.Buffers[buffer]
5429}
5430
5431macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
5432 assert(bufferView in State.BufferViews)
5433 return State.BufferViews[bufferView]
5434}
5435
5436macro ref!ImageObject GetImage(VkImage image) {
5437 assert(image in State.Images)
5438 return State.Images[image]
5439}
5440
5441macro ref!ImageViewObject GetImageView(VkImageView imageView) {
5442 assert(imageView in State.ImageViews)
5443 return State.ImageViews[imageView]
5444}
5445
Jesse Halld27f6aa2015-08-15 17:58:48 -07005446macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
5447 assert(shaderModule in State.ShaderModules)
5448 return State.ShaderModules[shaderModule]
5449}
5450
5451macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
5452 assert(pipeline in State.Pipelines)
5453 return State.Pipelines[pipeline]
5454}
5455
5456macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
5457 assert(pipelineLayout in State.PipelineLayouts)
5458 return State.PipelineLayouts[pipelineLayout]
5459}
5460
5461macro ref!SamplerObject GetSampler(VkSampler sampler) {
5462 assert(sampler in State.Samplers)
5463 return State.Samplers[sampler]
5464}
5465
5466macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
5467 assert(descriptorSet in State.DescriptorSets)
5468 return State.DescriptorSets[descriptorSet]
5469}
5470
5471macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
5472 assert(descriptorSetLayout in State.DescriptorSetLayouts)
5473 return State.DescriptorSetLayouts[descriptorSetLayout]
5474}
5475
5476macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
5477 assert(descriptorPool in State.DescriptorPools)
5478 return State.DescriptorPools[descriptorPool]
5479}
5480
Jesse Halld27f6aa2015-08-15 17:58:48 -07005481macro ref!FenceObject GetFence(VkFence fence) {
5482 assert(fence in State.Fences)
5483 return State.Fences[fence]
5484}
5485
5486macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
5487 assert(semaphore in State.Semaphores)
5488 return State.Semaphores[semaphore]
5489}
5490
5491macro ref!EventObject GetEvent(VkEvent event) {
5492 assert(event in State.Events)
5493 return State.Events[event]
5494}
5495
5496macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
5497 assert(queryPool in State.QueryPools)
5498 return State.QueryPools[queryPool]
5499}
5500
5501macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
5502 assert(framebuffer in State.Framebuffers)
5503 return State.Framebuffers[framebuffer]
5504}
5505
5506macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
5507 assert(renderPass in State.RenderPasses)
5508 return State.RenderPasses[renderPass]
5509}
5510
5511macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
5512 assert(pipelineCache in State.PipelineCaches)
5513 return State.PipelineCaches[pipelineCache]
5514}
5515
Jesse Hall3fbc8562015-11-29 22:10:52 -08005516macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
5517 assert(commandPool in State.CommandPools)
5518 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07005519}
Michael Lentine88594d72015-11-12 12:49:45 -08005520
Jesse Hall1356b0d2015-11-23 17:24:58 -08005521macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
5522 assert(surface in State.Surfaces)
5523 return State.Surfaces[surface]
5524}
5525
Michael Lentine88594d72015-11-12 12:49:45 -08005526macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
5527 assert(swapchain in State.Swapchains)
5528 return State.Swapchains[swapchain]
5529}
Jesse Halld8bade02015-11-24 10:24:18 -08005530
5531macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
5532 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
5533}