blob: 89ed6177e77b52e4774780cd9c35772da94d65ac [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)
29define VERSION_MAJOR 0
Jesse Hall091ed9e2015-11-30 00:55:29 -080030define VERSION_MINOR 202
Jesse Hallae38f732015-11-19 21:32:50 -080031define VERSION_PATCH 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_REVISION 22
49@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NUMBER 1
50@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080051
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_REVISION 64
53@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NUMBER 2
54@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080055
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080056@extension("VK_KHR_display") define VK_KHR_DISPLAY_REVISION 18
57@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NUMBER 3
58@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080060@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_REVISION 7
61@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_EXTENSION_NUMBER 4
62@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080063
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_REVISION 4
65@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NUMBER 5
66@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080067
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080068@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_REVISION 4
69@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NUMBER 6
70@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080072@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_REVISION 3
73@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NUMBER 7
74@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080075
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_REVISION 3
77@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NUMBER 8
78@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080079
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080080@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_REVISION 2
81@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NUMBER 8
82@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080083
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080084@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_REVISION 3
85@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NUMBER 9
86@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080087
Jesse Halld27f6aa2015-08-15 17:58:48 -070088
89/////////////
90// Types //
91/////////////
92
Jesse Hall5ae3abb2015-10-08 14:00:22 -070093type u32 VkBool32
94type u32 VkFlags
95type u64 VkDeviceSize
96type u32 VkSampleMask
97
Jesse Halld27f6aa2015-08-15 17:58:48 -070098/// Dispatchable handle types.
99@dispatchHandle type u64 VkInstance
100@dispatchHandle type u64 VkPhysicalDevice
101@dispatchHandle type u64 VkDevice
102@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800103@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700104
105/// Non dispatchable handle types.
106@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800107@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700108@nonDispatchHandle type u64 VkBuffer
109@nonDispatchHandle type u64 VkBufferView
110@nonDispatchHandle type u64 VkImage
111@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700112@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700113@nonDispatchHandle type u64 VkPipeline
114@nonDispatchHandle type u64 VkPipelineLayout
115@nonDispatchHandle type u64 VkSampler
116@nonDispatchHandle type u64 VkDescriptorSet
117@nonDispatchHandle type u64 VkDescriptorSetLayout
118@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700119@nonDispatchHandle type u64 VkFence
120@nonDispatchHandle type u64 VkSemaphore
121@nonDispatchHandle type u64 VkEvent
122@nonDispatchHandle type u64 VkQueryPool
123@nonDispatchHandle type u64 VkFramebuffer
124@nonDispatchHandle type u64 VkRenderPass
125@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800126
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800127@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800128
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800129@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800130
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800131@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
132@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700133
134
135/////////////
136// Enums //
137/////////////
138
139enum VkImageLayout {
140 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
141 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
142 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
143 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
144 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
145 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 -0800146 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
147 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 -0700148 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800149
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800150 //@extension("VK_KHR_swapchain")
Jesse Hall3fbc8562015-11-29 22:10:52 -0800151 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 0xc0000802,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700152}
153
154enum VkAttachmentLoadOp {
155 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
156 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
157 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
158}
159
160enum VkAttachmentStoreOp {
161 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
162 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
163}
164
165enum VkImageType {
166 VK_IMAGE_TYPE_1D = 0x00000000,
167 VK_IMAGE_TYPE_2D = 0x00000001,
168 VK_IMAGE_TYPE_3D = 0x00000002,
169}
170
171enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800172 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
173 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700174}
175
176enum VkImageViewType {
177 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
178 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
179 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
180 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
181 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
182 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
183 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
184}
185
Jesse Hall3fbc8562015-11-29 22:10:52 -0800186enum VkCommandBufferLevel {
187 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
188 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700189}
190
Jesse Hall65ab5522015-11-30 00:07:16 -0800191enum VkComponentSwizzle {
192 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
193 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
194 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
195 VK_COMPONENT_SWIZZLE_R = 0x00000003,
196 VK_COMPONENT_SWIZZLE_G = 0x00000004,
197 VK_COMPONENT_SWIZZLE_B = 0x00000005,
198 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700199}
200
201enum VkDescriptorType {
202 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
203 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
204 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
205 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
206 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
207 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
208 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
209 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
210 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
211 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
212 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
213}
214
Jesse Halld27f6aa2015-08-15 17:58:48 -0700215enum VkQueryType {
216 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
217 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800218 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700219}
220
Jesse Halld27f6aa2015-08-15 17:58:48 -0700221enum VkBorderColor {
222 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
223 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
224 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
225 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
226 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
227 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
228}
229
230enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800231 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
232 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700233}
234
235enum VkPrimitiveTopology {
236 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
237 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
238 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
239 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
240 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
241 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800242 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
243 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
244 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
245 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800246 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700247}
248
249enum VkSharingMode {
250 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
251 VK_SHARING_MODE_CONCURRENT = 0x00000001,
252}
253
254enum VkIndexType {
255 VK_INDEX_TYPE_UINT16 = 0x00000000,
256 VK_INDEX_TYPE_UINT32 = 0x00000001,
257}
258
Jesse Hall23ff73f2015-11-29 14:36:39 -0800259enum VkFilter {
260 VK_FILTER_NEAREST = 0x00000000,
261 VK_FILTER_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700262}
263
Jesse Hall23ff73f2015-11-29 14:36:39 -0800264enum VkSamplerMipmapMode {
265 VK_SAMPLER_MIPMAP_MODE_BASE = 0x00000000, /// Always choose base level
266 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
267 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700268}
269
Jesse Hall23ff73f2015-11-29 14:36:39 -0800270enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800271 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
272 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
273 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
274 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
275 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700276}
277
278enum VkCompareOp {
279 VK_COMPARE_OP_NEVER = 0x00000000,
280 VK_COMPARE_OP_LESS = 0x00000001,
281 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800282 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700283 VK_COMPARE_OP_GREATER = 0x00000004,
284 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800285 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700286 VK_COMPARE_OP_ALWAYS = 0x00000007,
287}
288
Jesse Hall65ab5522015-11-30 00:07:16 -0800289enum VkPolygonMode {
290 VK_POLYGON_MODE_FILL = 0x00000000,
291 VK_POLYGON_MODE_LINE = 0x00000001,
292 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700293}
294
295enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800296 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
297 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700298}
299
Jesse Hall65ab5522015-11-30 00:07:16 -0800300enum VkBlendFactor {
301 VK_BLEND_FACTOR_ZERO = 0x00000000,
302 VK_BLEND_FACTOR_ONE = 0x00000001,
303 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
304 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
305 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
306 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
307 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
308 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
309 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
310 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
311 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
312 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
313 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
314 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
315 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
316 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
317 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
318 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
319 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700320}
321
322enum VkBlendOp {
323 VK_BLEND_OP_ADD = 0x00000000,
324 VK_BLEND_OP_SUBTRACT = 0x00000001,
325 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
326 VK_BLEND_OP_MIN = 0x00000003,
327 VK_BLEND_OP_MAX = 0x00000004,
328}
329
330enum VkStencilOp {
331 VK_STENCIL_OP_KEEP = 0x00000000,
332 VK_STENCIL_OP_ZERO = 0x00000001,
333 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800334 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
335 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700336 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800337 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
338 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700339}
340
341enum VkLogicOp {
342 VK_LOGIC_OP_CLEAR = 0x00000000,
343 VK_LOGIC_OP_AND = 0x00000001,
344 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
345 VK_LOGIC_OP_COPY = 0x00000003,
346 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800347 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700348 VK_LOGIC_OP_XOR = 0x00000006,
349 VK_LOGIC_OP_OR = 0x00000007,
350 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800351 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700352 VK_LOGIC_OP_INVERT = 0x0000000a,
353 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
354 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
355 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
356 VK_LOGIC_OP_NAND = 0x0000000e,
357 VK_LOGIC_OP_SET = 0x0000000f,
358}
359
Jesse Hall3fbc8562015-11-29 22:10:52 -0800360enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800361 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800362 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
363 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
364 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
365 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800366}
367
Jesse Hall3fbc8562015-11-29 22:10:52 -0800368enum VkInternalAllocationType {
369 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700370}
371
372enum VkPhysicalDeviceType {
373 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
374 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
375 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
376 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
377 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
378}
379
Jesse Hall65ab5522015-11-30 00:07:16 -0800380enum VkVertexInputRate {
381 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
382 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700383}
384
385/// Vulkan format definitions
386enum VkFormat {
387 VK_FORMAT_UNDEFINED = 0x00000000,
388 VK_FORMAT_R4G4_UNORM = 0x00000001,
389 VK_FORMAT_R4G4_USCALED = 0x00000002,
390 VK_FORMAT_R4G4B4A4_UNORM = 0x00000003,
391 VK_FORMAT_R4G4B4A4_USCALED = 0x00000004,
392 VK_FORMAT_R5G6B5_UNORM = 0x00000005,
393 VK_FORMAT_R5G6B5_USCALED = 0x00000006,
394 VK_FORMAT_R5G5B5A1_UNORM = 0x00000007,
395 VK_FORMAT_R5G5B5A1_USCALED = 0x00000008,
396 VK_FORMAT_R8_UNORM = 0x00000009,
397 VK_FORMAT_R8_SNORM = 0x0000000A,
398 VK_FORMAT_R8_USCALED = 0x0000000B,
399 VK_FORMAT_R8_SSCALED = 0x0000000C,
400 VK_FORMAT_R8_UINT = 0x0000000D,
401 VK_FORMAT_R8_SINT = 0x0000000E,
402 VK_FORMAT_R8_SRGB = 0x0000000F,
403 VK_FORMAT_R8G8_UNORM = 0x00000010,
404 VK_FORMAT_R8G8_SNORM = 0x00000011,
405 VK_FORMAT_R8G8_USCALED = 0x00000012,
406 VK_FORMAT_R8G8_SSCALED = 0x00000013,
407 VK_FORMAT_R8G8_UINT = 0x00000014,
408 VK_FORMAT_R8G8_SINT = 0x00000015,
409 VK_FORMAT_R8G8_SRGB = 0x00000016,
410 VK_FORMAT_R8G8B8_UNORM = 0x00000017,
411 VK_FORMAT_R8G8B8_SNORM = 0x00000018,
412 VK_FORMAT_R8G8B8_USCALED = 0x00000019,
413 VK_FORMAT_R8G8B8_SSCALED = 0x0000001A,
414 VK_FORMAT_R8G8B8_UINT = 0x0000001B,
415 VK_FORMAT_R8G8B8_SINT = 0x0000001C,
416 VK_FORMAT_R8G8B8_SRGB = 0x0000001D,
417 VK_FORMAT_R8G8B8A8_UNORM = 0x0000001E,
418 VK_FORMAT_R8G8B8A8_SNORM = 0x0000001F,
419 VK_FORMAT_R8G8B8A8_USCALED = 0x00000020,
420 VK_FORMAT_R8G8B8A8_SSCALED = 0x00000021,
421 VK_FORMAT_R8G8B8A8_UINT = 0x00000022,
422 VK_FORMAT_R8G8B8A8_SINT = 0x00000023,
423 VK_FORMAT_R8G8B8A8_SRGB = 0x00000024,
424 VK_FORMAT_R10G10B10A2_UNORM = 0x00000025,
425 VK_FORMAT_R10G10B10A2_SNORM = 0x00000026,
426 VK_FORMAT_R10G10B10A2_USCALED = 0x00000027,
427 VK_FORMAT_R10G10B10A2_SSCALED = 0x00000028,
428 VK_FORMAT_R10G10B10A2_UINT = 0x00000029,
429 VK_FORMAT_R10G10B10A2_SINT = 0x0000002A,
430 VK_FORMAT_R16_UNORM = 0x0000002B,
431 VK_FORMAT_R16_SNORM = 0x0000002C,
432 VK_FORMAT_R16_USCALED = 0x0000002D,
433 VK_FORMAT_R16_SSCALED = 0x0000002E,
434 VK_FORMAT_R16_UINT = 0x0000002F,
435 VK_FORMAT_R16_SINT = 0x00000030,
436 VK_FORMAT_R16_SFLOAT = 0x00000031,
437 VK_FORMAT_R16G16_UNORM = 0x00000032,
438 VK_FORMAT_R16G16_SNORM = 0x00000033,
439 VK_FORMAT_R16G16_USCALED = 0x00000034,
440 VK_FORMAT_R16G16_SSCALED = 0x00000035,
441 VK_FORMAT_R16G16_UINT = 0x00000036,
442 VK_FORMAT_R16G16_SINT = 0x00000037,
443 VK_FORMAT_R16G16_SFLOAT = 0x00000038,
444 VK_FORMAT_R16G16B16_UNORM = 0x00000039,
445 VK_FORMAT_R16G16B16_SNORM = 0x0000003A,
446 VK_FORMAT_R16G16B16_USCALED = 0x0000003B,
447 VK_FORMAT_R16G16B16_SSCALED = 0x0000003C,
448 VK_FORMAT_R16G16B16_UINT = 0x0000003D,
449 VK_FORMAT_R16G16B16_SINT = 0x0000003E,
450 VK_FORMAT_R16G16B16_SFLOAT = 0x0000003F,
451 VK_FORMAT_R16G16B16A16_UNORM = 0x00000040,
452 VK_FORMAT_R16G16B16A16_SNORM = 0x00000041,
453 VK_FORMAT_R16G16B16A16_USCALED = 0x00000042,
454 VK_FORMAT_R16G16B16A16_SSCALED = 0x00000043,
455 VK_FORMAT_R16G16B16A16_UINT = 0x00000044,
456 VK_FORMAT_R16G16B16A16_SINT = 0x00000045,
457 VK_FORMAT_R16G16B16A16_SFLOAT = 0x00000046,
458 VK_FORMAT_R32_UINT = 0x00000047,
459 VK_FORMAT_R32_SINT = 0x00000048,
460 VK_FORMAT_R32_SFLOAT = 0x00000049,
461 VK_FORMAT_R32G32_UINT = 0x0000004A,
462 VK_FORMAT_R32G32_SINT = 0x0000004B,
463 VK_FORMAT_R32G32_SFLOAT = 0x0000004C,
464 VK_FORMAT_R32G32B32_UINT = 0x0000004D,
465 VK_FORMAT_R32G32B32_SINT = 0x0000004E,
466 VK_FORMAT_R32G32B32_SFLOAT = 0x0000004F,
467 VK_FORMAT_R32G32B32A32_UINT = 0x00000050,
468 VK_FORMAT_R32G32B32A32_SINT = 0x00000051,
469 VK_FORMAT_R32G32B32A32_SFLOAT = 0x00000052,
470 VK_FORMAT_R64_SFLOAT = 0x00000053,
471 VK_FORMAT_R64G64_SFLOAT = 0x00000054,
472 VK_FORMAT_R64G64B64_SFLOAT = 0x00000055,
473 VK_FORMAT_R64G64B64A64_SFLOAT = 0x00000056,
474 VK_FORMAT_R11G11B10_UFLOAT = 0x00000057,
475 VK_FORMAT_R9G9B9E5_UFLOAT = 0x00000058,
476 VK_FORMAT_D16_UNORM = 0x00000059,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700477 VK_FORMAT_D24_UNORM_X8 = 0x0000005A,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700478 VK_FORMAT_D32_SFLOAT = 0x0000005B,
479 VK_FORMAT_S8_UINT = 0x0000005C,
480 VK_FORMAT_D16_UNORM_S8_UINT = 0x0000005D,
481 VK_FORMAT_D24_UNORM_S8_UINT = 0x0000005E,
482 VK_FORMAT_D32_SFLOAT_S8_UINT = 0x0000005F,
483 VK_FORMAT_BC1_RGB_UNORM = 0x00000060,
484 VK_FORMAT_BC1_RGB_SRGB = 0x00000061,
485 VK_FORMAT_BC1_RGBA_UNORM = 0x00000062,
486 VK_FORMAT_BC1_RGBA_SRGB = 0x00000063,
487 VK_FORMAT_BC2_UNORM = 0x00000064,
488 VK_FORMAT_BC2_SRGB = 0x00000065,
489 VK_FORMAT_BC3_UNORM = 0x00000066,
490 VK_FORMAT_BC3_SRGB = 0x00000067,
491 VK_FORMAT_BC4_UNORM = 0x00000068,
492 VK_FORMAT_BC4_SNORM = 0x00000069,
493 VK_FORMAT_BC5_UNORM = 0x0000006A,
494 VK_FORMAT_BC5_SNORM = 0x0000006B,
495 VK_FORMAT_BC6H_UFLOAT = 0x0000006C,
496 VK_FORMAT_BC6H_SFLOAT = 0x0000006D,
497 VK_FORMAT_BC7_UNORM = 0x0000006E,
498 VK_FORMAT_BC7_SRGB = 0x0000006F,
499 VK_FORMAT_ETC2_R8G8B8_UNORM = 0x00000070,
500 VK_FORMAT_ETC2_R8G8B8_SRGB = 0x00000071,
501 VK_FORMAT_ETC2_R8G8B8A1_UNORM = 0x00000072,
502 VK_FORMAT_ETC2_R8G8B8A1_SRGB = 0x00000073,
503 VK_FORMAT_ETC2_R8G8B8A8_UNORM = 0x00000074,
504 VK_FORMAT_ETC2_R8G8B8A8_SRGB = 0x00000075,
505 VK_FORMAT_EAC_R11_UNORM = 0x00000076,
506 VK_FORMAT_EAC_R11_SNORM = 0x00000077,
507 VK_FORMAT_EAC_R11G11_UNORM = 0x00000078,
508 VK_FORMAT_EAC_R11G11_SNORM = 0x00000079,
509 VK_FORMAT_ASTC_4x4_UNORM = 0x0000007A,
510 VK_FORMAT_ASTC_4x4_SRGB = 0x0000007B,
511 VK_FORMAT_ASTC_5x4_UNORM = 0x0000007C,
512 VK_FORMAT_ASTC_5x4_SRGB = 0x0000007D,
513 VK_FORMAT_ASTC_5x5_UNORM = 0x0000007E,
514 VK_FORMAT_ASTC_5x5_SRGB = 0x0000007F,
515 VK_FORMAT_ASTC_6x5_UNORM = 0x00000080,
516 VK_FORMAT_ASTC_6x5_SRGB = 0x00000081,
517 VK_FORMAT_ASTC_6x6_UNORM = 0x00000082,
518 VK_FORMAT_ASTC_6x6_SRGB = 0x00000083,
519 VK_FORMAT_ASTC_8x5_UNORM = 0x00000084,
520 VK_FORMAT_ASTC_8x5_SRGB = 0x00000085,
521 VK_FORMAT_ASTC_8x6_UNORM = 0x00000086,
522 VK_FORMAT_ASTC_8x6_SRGB = 0x00000087,
523 VK_FORMAT_ASTC_8x8_UNORM = 0x00000088,
524 VK_FORMAT_ASTC_8x8_SRGB = 0x00000089,
525 VK_FORMAT_ASTC_10x5_UNORM = 0x0000008A,
526 VK_FORMAT_ASTC_10x5_SRGB = 0x0000008B,
527 VK_FORMAT_ASTC_10x6_UNORM = 0x0000008C,
528 VK_FORMAT_ASTC_10x6_SRGB = 0x0000008D,
529 VK_FORMAT_ASTC_10x8_UNORM = 0x0000008E,
530 VK_FORMAT_ASTC_10x8_SRGB = 0x0000008F,
531 VK_FORMAT_ASTC_10x10_UNORM = 0x00000090,
532 VK_FORMAT_ASTC_10x10_SRGB = 0x00000091,
533 VK_FORMAT_ASTC_12x10_UNORM = 0x00000092,
534 VK_FORMAT_ASTC_12x10_SRGB = 0x00000093,
535 VK_FORMAT_ASTC_12x12_UNORM = 0x00000094,
536 VK_FORMAT_ASTC_12x12_SRGB = 0x00000095,
537 VK_FORMAT_B4G4R4A4_UNORM = 0x00000096,
538 VK_FORMAT_B5G5R5A1_UNORM = 0x00000097,
539 VK_FORMAT_B5G6R5_UNORM = 0x00000098,
540 VK_FORMAT_B5G6R5_USCALED = 0x00000099,
541 VK_FORMAT_B8G8R8_UNORM = 0x0000009A,
542 VK_FORMAT_B8G8R8_SNORM = 0x0000009B,
543 VK_FORMAT_B8G8R8_USCALED = 0x0000009C,
544 VK_FORMAT_B8G8R8_SSCALED = 0x0000009D,
545 VK_FORMAT_B8G8R8_UINT = 0x0000009E,
546 VK_FORMAT_B8G8R8_SINT = 0x0000009F,
547 VK_FORMAT_B8G8R8_SRGB = 0x000000A0,
548 VK_FORMAT_B8G8R8A8_UNORM = 0x000000A1,
549 VK_FORMAT_B8G8R8A8_SNORM = 0x000000A2,
550 VK_FORMAT_B8G8R8A8_USCALED = 0x000000A3,
551 VK_FORMAT_B8G8R8A8_SSCALED = 0x000000A4,
552 VK_FORMAT_B8G8R8A8_UINT = 0x000000A5,
553 VK_FORMAT_B8G8R8A8_SINT = 0x000000A6,
554 VK_FORMAT_B8G8R8A8_SRGB = 0x000000A7,
555 VK_FORMAT_B10G10R10A2_UNORM = 0x000000A8,
556 VK_FORMAT_B10G10R10A2_SNORM = 0x000000A9,
557 VK_FORMAT_B10G10R10A2_USCALED = 0x000000AA,
558 VK_FORMAT_B10G10R10A2_SSCALED = 0x000000AB,
559 VK_FORMAT_B10G10R10A2_UINT = 0x000000AC,
560 VK_FORMAT_B10G10R10A2_SINT = 0x000000AD,
561}
562
Jesse Halld27f6aa2015-08-15 17:58:48 -0700563/// Structure type enumerant
564enum VkStructureType {
565 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800566 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
567 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
568 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
569 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
570 VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO = 5,
571 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
572 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
573 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
574 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700575 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800576 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
577 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
578 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
579 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
580 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
581 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800582 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
583 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
584 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
585 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
586 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
587 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
588 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
589 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
590 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
591 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
592 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
593 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
594 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
595 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
596 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
597 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
598 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
599 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOC_INFO = 34,
600 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
601 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
602 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
603 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
604 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
605 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOC_INFO = 40,
606 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 41,
607 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 42,
608 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 43,
609 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 44,
610 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 45,
611 VK_STRUCTURE_TYPE_LAYER_INSTANCE_CREATE_INFO = 46,
612 VK_STRUCTURE_TYPE_LAYER_DEVICE_CREATE_INFO = 47,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800613
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800614 //@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -0800615 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 0xc0000801,
616
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800617 //@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -0800618 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 0xc0000c00,
Jesse Halla6429252015-11-29 18:59:42 -0800619 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 0xc0000c01,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800620
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800621 //@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -0800622 VK_STRUCTURE_TYPE_DISPLAY_SWAPCHAIN_CREATE_INFO_KHR = 0xc0001000,
623 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 0xc0001001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700624}
625
Jesse Hall65ab5522015-11-30 00:07:16 -0800626enum VkSubpassContents {
627 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
628 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700629}
630
Jesse Hall091ed9e2015-11-30 00:55:29 -0800631@lastUnused(-10)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700632/// Error and return codes
633enum VkResult {
634 // Return codes for successful operation execution (positive values)
635 VK_SUCCESS = 0x00000000,
Jesse Halla15a4bf2015-11-19 22:48:02 -0800636 VK_NOT_READY = 0x00000001,
637 VK_TIMEOUT = 0x00000002,
638 VK_EVENT_SET = 0x00000003,
639 VK_EVENT_RESET = 0x00000004,
640 VK_INCOMPLETE = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700641
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800642 //@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -0800643 VK_SUBOPTIMAL_KHR = 0x40000403,
644
Jesse Halld27f6aa2015-08-15 17:58:48 -0700645 // Error codes (negative values)
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700646 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF,
647 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700648 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700649 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC,
650 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB,
651 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA,
652 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9,
Jesse Hall606a54e2015-11-19 22:17:28 -0800653 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8,
654 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800655 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800656
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800657 //@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -0800658 VK_ERROR_SURFACE_LOST_KHR = 0xC0000400,
659
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800660 //@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -0800661 VK_ERROR_OUT_OF_DATE_KHR = 0xC0000804,
662
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800663 //@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -0800664 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC0001002,
665
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800666 //@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -0800667 VK_ERROR_INVALID_ANDROID_WINDOW_KHR = 0xC002400,
668 VK_ERROR_ANDROID_WINDOW_IN_USE_KHR = 0xC002401,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700669}
670
671enum VkDynamicState {
672 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
673 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
674 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
675 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
676 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
677 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
678 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
679 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
680 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700681}
682
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800683@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800684enum VkSurfaceTransformKHR {
685 VK_SURFACE_TRANSFORM_NONE_KHR = 0x00000000,
686 VK_SURFACE_TRANSFORM_ROT90_KHR = 0x00000001,
687 VK_SURFACE_TRANSFORM_ROT180_KHR = 0x00000002,
688 VK_SURFACE_TRANSFORM_ROT270_KHR = 0x00000003,
689 VK_SURFACE_TRANSFORM_HMIRROR_KHR = 0x00000004,
690 VK_SURFACE_TRANSFORM_HMIRROR_ROT90_KHR = 0x00000005,
691 VK_SURFACE_TRANSFORM_HMIRROR_ROT180_KHR = 0x00000006,
692 VK_SURFACE_TRANSFORM_HMIRROR_ROT270_KHR = 0x00000007,
693 VK_SURFACE_TRANSFORM_INHERIT_KHR = 0x00000008,
694}
695
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800696@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -0800697enum VkPresentModeKHR {
698 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
699 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
700 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800701 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800702}
703
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800704@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -0800705enum VkColorSpaceKHR {
706 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
707}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700708
709/////////////////
710// Bitfields //
711/////////////////
712
Jesse Halld27f6aa2015-08-15 17:58:48 -0700713/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -0800714type VkFlags VkQueueFlags
715bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700716 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
717 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -0800718 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -0800719 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700720}
721
722/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -0800723type VkFlags VkMemoryPropertyFlags
724bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800725 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
726 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
727 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
728 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
729 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700730}
731
732/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -0800733type VkFlags VkMemoryHeapFlags
734bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800735 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700736}
737
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800738/// Access flags
739type VkFlags VkAccessFlags
740bitfield VkAccessFlagBits {
741 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
742 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
743 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
744 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
745 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
746 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
747 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
748 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
749 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
750 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
751 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
752 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
753 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
754 VK_ACCESS_HOST_READ_BIT = 0x00002000,
755 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
756 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
757 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700758}
759
760/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800761type VkFlags VkBufferUsageFlags
762bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800763 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
764 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700765 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
766 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
767 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
768 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
769 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
770 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
771 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
772}
773
774/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800775type VkFlags VkBufferCreateFlags
776bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700777 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700778 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
779 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
780}
781
782/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800783type VkFlags VkShaderStageFlags
784bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700785 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -0800786 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
787 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700788 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
789 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
790 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -0800791 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700792
793 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
794}
795
Jesse Hallfbf97b02015-11-20 14:17:03 -0800796/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -0800797type VkFlags VkDescriptorPoolCreateFlags
798bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800799 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
800}
801
802/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -0800803type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -0800804//bitfield VkDescriptorPoolResetFlagBits {
805//}
Jesse Hallfbf97b02015-11-20 14:17:03 -0800806
Jesse Halld27f6aa2015-08-15 17:58:48 -0700807/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800808type VkFlags VkImageUsageFlags
809bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800810 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
811 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700812 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
813 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
814 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700815 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -0700816 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
817 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
818}
819
820/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800821type VkFlags VkImageCreateFlags
822bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700823 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700824 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
825 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 -0700826 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
827 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 -0700828}
829
Jesse Hallb00daad2015-11-29 19:46:20 -0800830/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800831type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -0800832//bitfield VkImageViewCreateFlagBits {
833//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700834
835/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800836type VkFlags VkPipelineCreateFlags
837bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700838 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
839 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
840 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
841}
842
Jesse Hall65ab5522015-11-30 00:07:16 -0800843/// Color component flags
844type VkFlags VkColorComponentFlags
845bitfield VkColorComponentFlagBits {
846 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
847 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
848 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
849 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700850}
851
852/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800853type VkFlags VkFenceCreateFlags
854bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700855 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
856}
857
858/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800859type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800860//bitfield VkSemaphoreCreateFlagBits {
861//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700862
863/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -0800864type VkFlags VkFormatFeatureFlags
865bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700866 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
867 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
868 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
869 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
870 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
871 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
872 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
873 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
874 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
875 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -0800876 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
877 VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCommandBlitImage
Jesse Halld27f6aa2015-08-15 17:58:48 -0700878}
879
880/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -0800881type VkFlags VkQueryControlFlags
882bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -0800883 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700884}
885
886/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -0800887type VkFlags VkQueryResultFlags
888bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700889 VK_QUERY_RESULT_DEFAULT = 0x00000000, /// Results of the queries are immediately written to the destination buffer as 32-bit values
890 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
891 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
892 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
893 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
894}
895
896/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800897type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800898//bitfield VkShaderModuleCreateFlagBits {
899//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700900
Jesse Halld27f6aa2015-08-15 17:58:48 -0700901/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800902type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800903//bitfield VkEventCreateFlagBits {
904//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700905
Jesse Halla15a4bf2015-11-19 22:48:02 -0800906/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -0800907type VkFlags VkCommandBufferUsageFlags
908bitfield VkCommandBufferUsageFlagBits {
909 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
910 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
911 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700912}
913
914/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -0800915type VkFlags VkQueryPipelineStatisticFlags
916bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -0800917 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
918 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
919 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
920 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
921 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
922 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
923 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
924 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
925 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
926 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
927 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -0700928}
929
930/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -0800931type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -0800932//bitfield VkMemoryMapFlagBits {
933//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700934
935/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -0800936type VkFlags VkImageAspectFlags
937bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700938 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
939 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
940 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
941 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
942}
943
944/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -0800945type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -0800946bitfield VkSparseMemoryBindFlagBits {
947 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
948}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700949
950/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -0800951type VkFlags VkSparseImageFormatFlags
952bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -0800953 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
954 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.
955 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -0700956}
957
958/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -0800959type VkFlags VkPipelineStageFlags
960bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700961 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
962 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
963 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
964 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -0800965 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
966 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -0700967 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
968 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
969 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
970 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
971 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
972 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
973 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700974 VK_PIPELINE_STAGE_HOST_BIT = 0x00002000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -0700975
Jesse Hall091ed9e2015-11-30 00:55:29 -0800976 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00004000, /// All stages of the graphics pipeline
977 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00008000, /// All graphics, compute, copy, and transition commands
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700978}
979
980/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -0800981type VkFlags VkAttachmentDescriptionFlags
982bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700983 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 -0700984}
985
986/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -0800987type VkFlags VkSubpassDescriptionFlags
988bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700989}
990
991/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -0800992type VkFlags VkCommandPoolCreateFlags
993bitfield VkCommandPoolCreateFlagBits {
994 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
995 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -0700996}
997
998/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -0800999type VkFlags VkCommandPoolResetFlags
1000bitfield VkCommandPoolResetFlagBits {
1001 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001002}
1003
Jesse Hall3fbc8562015-11-29 22:10:52 -08001004type VkFlags VkCommandBufferResetFlags
1005bitfield VkCommandBufferResetFlagBits {
1006 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001007}
1008
Jesse Halld8bade02015-11-24 10:24:18 -08001009type VkFlags VkSampleCountFlags
1010bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001011 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1012 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1013 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1014 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1015 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1016 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1017 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1018}
1019
Jesse Halld8bade02015-11-24 10:24:18 -08001020type VkFlags VkStencilFaceFlags
1021bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001022 VK_STENCIL_FACE_NONE = 0x00000000, /// No faces
1023 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1024 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001025 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001026}
1027
Jesse Halla6429252015-11-29 18:59:42 -08001028/// Instance creation flags
1029type VkFlags VkInstanceCreateFlags
1030//bitfield VkInstanceCreateFlagBits {
1031//}
1032
1033/// Device creation flags
1034type VkFlags VkDeviceCreateFlags
1035//bitfield VkDeviceCreateFlagBits {
1036//}
1037
1038/// Device queue creation flags
1039type VkFlags VkDeviceQueueCreateFlags
1040//bitfield VkDeviceQueueCreateFlagBits {
1041//}
1042
1043/// Query pool creation flags
1044type VkFlags VkQueryPoolCreateFlags
1045//bitfield VkQueryPoolCreateFlagBits {
1046//}
1047
1048/// Buffer view creation flags
1049type VkFlags VkBufferViewCreateFlags
1050//bitfield VkBufferViewCreateFlagBits {
1051//}
1052
1053/// Pipeline cache creation flags
1054type VkFlags VkPipelineCacheCreateFlags
1055//bitfield VkPipelineCacheCreateFlagBits {
1056//}
1057
1058/// Pipeline shader stage creation flags
1059type VkFlags VkPipelineShaderStageCreateFlags
1060//bitfield VkPipelineShaderStageCreateFlagBits {
1061//}
1062
1063/// Descriptor set layout creation flags
1064type VkFlags VkDescriptorSetLayoutCreateFlags
1065//bitfield VkDescriptorSetLayoutCreateFlagBits {
1066//}
1067
1068/// Pipeline vertex input state creation flags
1069type VkFlags VkPipelineVertexInputStateCreateFlags
1070//bitfield VkPipelineVertexInputStateCreateFlagBits {
1071//}
1072
1073/// Pipeline input assembly state creation flags
1074type VkFlags VkPipelineInputAssemblyStateCreateFlags
1075//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1076//}
1077
1078/// Tessellation state creation flags
1079type VkFlags VkPipelineTessellationStateCreateFlags
1080//bitfield VkPipelineTessellationStateCreateFlagBits {
1081//}
1082
1083/// Viewport state creation flags
1084type VkFlags VkPipelineViewportStateCreateFlags
1085//bitfield VkPipelineViewportStateCreateFlagBits {
1086//}
1087
Jesse Hall3fbc8562015-11-29 22:10:52 -08001088/// Rasterization state creation flags
1089type VkFlags VkPipelineRasterizationStateCreateFlags
1090//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001091//}
1092
1093/// Multisample state creation flags
1094type VkFlags VkPipelineMultisampleStateCreateFlags
1095//bitfield VkPipelineMultisampleStateCreateFlagBits {
1096//}
1097
1098/// Color blend state creation flags
1099type VkFlags VkPipelineColorBlendStateCreateFlags
1100//bitfield VkPipelineColorBlendStateCreateFlagBits {
1101//}
1102
1103/// Depth/stencil state creation flags
1104type VkFlags VkPipelineDepthStencilStateCreateFlags
1105//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1106//}
1107
1108/// Dynamic state creation flags
1109type VkFlags VkPipelineDynamicStateCreateFlags
1110//bitfield VkPipelineDynamicStateCreateFlagBits {
1111//}
1112
1113/// Pipeline layout creation flags
1114type VkFlags VkPipelineLayoutCreateFlags
1115//bitfield VkPipelineLayoutCreateFlagBits {
1116//}
1117
1118/// Sampler creation flags
1119type VkFlags VkSamplerCreateFlags
1120//bitfield VkSamplerCreateFlagBits {
1121//}
1122
1123/// Render pass creation flags
1124type VkFlags VkRenderPassCreateFlags
1125//bitfield VkRenderPassCreateFlagBits {
1126//}
1127
1128/// Framebuffer creation flags
1129type VkFlags VkFramebufferCreateFlags
1130//bitfield VkFramebufferCreateFlagBits {
1131//}
1132
Jesse Halldc6d36c2015-11-29 19:12:15 -08001133/// Dependency flags
1134type VkFlags VkDependencyFlags
1135bitfield VkDependencyFlagBits {
1136 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1137}
1138
Jesse Hallc7467b72015-11-29 21:05:26 -08001139/// Cull mode flags
1140type VkFlags VkCullModeFlags
1141bitfield VkCullModeFlagBits {
1142 VK_CULL_MODE_NONE = 0x00000000,
1143 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1144 VK_CULL_MODE_BACK_BIT = 0x00000002,
1145 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1146}
1147
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001148@extension("VK_KHR_swapchain")
Jesse Halld8bade02015-11-24 10:24:18 -08001149type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001150@extension("VK_KHR_swapchain")
Jesse Halld8bade02015-11-24 10:24:18 -08001151bitfield VkSurfaceTransformFlagBitsKHR {
Michael Lentine88594d72015-11-12 12:49:45 -08001152 VK_SURFACE_TRANSFORM_NONE_BIT_KHR = 0x00000001,
1153 VK_SURFACE_TRANSFORM_ROT90_BIT_KHR = 0x00000002,
1154 VK_SURFACE_TRANSFORM_ROT180_BIT_KHR = 0x00000004,
1155 VK_SURFACE_TRANSFORM_ROT270_BIT_KHR = 0x00000008,
1156 VK_SURFACE_TRANSFORM_HMIRROR_BIT_KHR = 0x00000010,
1157 VK_SURFACE_TRANSFORM_HMIRROR_ROT90_BIT_KHR = 0x00000020,
1158 VK_SURFACE_TRANSFORM_HMIRROR_ROT180_BIT_KHR = 0x00000040,
1159 VK_SURFACE_TRANSFORM_HMIRROR_ROT270_BIT_KHR = 0x00000080,
1160 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
1161}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001162
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001163@extension("VK_KHR_swapchain")
Jesse Halla6429252015-11-29 18:59:42 -08001164type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001165@extension("VK_KHR_swapchain")
Jesse Halla6429252015-11-29 18:59:42 -08001166bitfield VkCompositeAlphaFlagBitsKHR {
1167 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1168 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1169 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1170 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1171}
1172
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001173@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001174type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001175@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001176bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08001177 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000001,
1178 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000002,
1179 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000004,
1180}
1181
1182
Jesse Halld27f6aa2015-08-15 17:58:48 -07001183//////////////////
1184// Structures //
1185//////////////////
1186
1187class VkOffset2D {
1188 s32 x
1189 s32 y
1190}
1191
1192class VkOffset3D {
1193 s32 x
1194 s32 y
1195 s32 z
1196}
1197
1198class VkExtent2D {
1199 s32 width
1200 s32 height
1201}
1202
1203class VkExtent3D {
1204 s32 width
1205 s32 height
1206 s32 depth
1207}
1208
1209class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001210 f32 x
1211 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001212 f32 width
1213 f32 height
1214 f32 minDepth
1215 f32 maxDepth
1216}
1217
1218class VkRect2D {
1219 VkOffset2D offset
1220 VkExtent2D extent
1221}
1222
Jesse Halla15a4bf2015-11-19 22:48:02 -08001223class VkClearRect {
1224 VkRect2D rect
1225 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001226 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001227}
1228
Jesse Hall65ab5522015-11-30 00:07:16 -08001229class VkComponentMapping {
1230 VkComponentSwizzle r
1231 VkComponentSwizzle g
1232 VkComponentSwizzle b
1233 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001234}
1235
1236class VkPhysicalDeviceProperties {
1237 u32 apiVersion
1238 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001239 u32 vendorID
1240 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001241 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001242 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1243 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001244 VkPhysicalDeviceLimits limits
1245 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001246}
1247
1248class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001249 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001250 u32 specVersion /// version of the extension specification implemented
1251}
1252
1253class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001254 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001255 u32 specVersion /// version of the layer specification implemented
1256 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001257 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001258}
1259
Jesse Halla366a512015-11-19 22:30:07 -08001260class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001261 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1262 const void* pNext /// Next structure in chain
1263 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001264 const VkSemaphore* pWaitSemaphores
Jesse Hall03b6fe12015-11-24 12:44:21 -08001265 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001266 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001267 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001268 const VkSemaphore* pSignalSemaphores
1269}
1270
Jesse Halld27f6aa2015-08-15 17:58:48 -07001271class VkApplicationInfo {
1272 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1273 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001274 const char* pApplicationName
1275 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001276 const char* pEngineName
1277 u32 engineVersion
1278 u32 apiVersion
1279}
1280
Jesse Hall3fbc8562015-11-29 22:10:52 -08001281class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001282 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001283 PFN_vkAllocationFunction pfnAllocation
1284 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001285 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001286 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001287 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001288}
1289
1290class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001291 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1292 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001293 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001294 u32 queueFamilyIndex
Jesse Hall03b6fe12015-11-24 12:44:21 -08001295 u32 queuePriorityCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001296 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001297}
1298
1299class VkDeviceCreateInfo {
1300 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1301 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001302 VkDeviceCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001303 u32 requestedQueueRecordCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001304 const VkDeviceQueueCreateInfo* pRequestedQueues
Jesse Hall03b6fe12015-11-24 12:44:21 -08001305 u32 enabledLayerNameCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001306 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall03b6fe12015-11-24 12:44:21 -08001307 u32 enabledExtensionNameCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001308 const char* const* ppEnabledExtensionNames
1309 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001310}
1311
1312class VkInstanceCreateInfo {
1313 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1314 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001315 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001316 const VkApplicationInfo* pApplicationInfo
Jesse Hall03b6fe12015-11-24 12:44:21 -08001317 u32 enabledLayerNameCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001318 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall03b6fe12015-11-24 12:44:21 -08001319 u32 enabledExtensionNameCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001320 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1321}
1322
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001323class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001324 VkQueueFlags queueFlags /// Queue flags
1325 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001326 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001327 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001328}
1329
1330class VkPhysicalDeviceMemoryProperties {
1331 u32 memoryTypeCount
1332 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1333 u32 memoryHeapCount
1334 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1335}
1336
Jesse Hall3fbc8562015-11-29 22:10:52 -08001337class VkMemoryAllocateInfo {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001338 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO
1339 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001340 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001341 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1342}
1343
1344class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001345 VkDeviceSize size /// Specified in bytes
1346 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001347 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1348}
1349
1350class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001351 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001352 VkExtent3D imageGranularity
1353 VkSparseImageFormatFlags flags
1354}
1355
1356class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001357 VkSparseImageFormatProperties formatProperties
Jesse Hall65ab5522015-11-30 00:07:16 -08001358 u32 imageMipTailStartLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001359 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1360 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1361 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001362}
1363
1364class VkMemoryType {
1365 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1366 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1367}
1368
1369class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001370 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001371 VkMemoryHeapFlags flags /// Flags for the heap
1372}
1373
1374class VkMappedMemoryRange {
1375 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1376 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001377 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001378 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1379 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001380}
1381
1382class VkFormatProperties {
1383 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1384 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001385 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001386}
1387
1388class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001389 VkExtent3D maxExtent /// max image dimensions for this resource type
1390 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001391 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001392 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1393 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1394}
1395
Jesse Halla15a4bf2015-11-19 22:48:02 -08001396class VkDescriptorImageInfo {
1397 VkSampler sampler
1398 VkImageView imageView
1399 VkImageLayout imageLayout
1400}
1401
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001402class VkDescriptorBufferInfo {
1403 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1404 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1405 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001406}
1407
Jesse Halld27f6aa2015-08-15 17:58:48 -07001408class VkWriteDescriptorSet {
1409 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1410 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001411 VkDescriptorSet dstSet /// Destination descriptor set
1412 u32 dstBinding /// Binding within the destination descriptor set to write
1413 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001414 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001415 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 -08001416 const VkDescriptorImageInfo* pImageInfo
1417 const VkDescriptorBufferInfo* pBufferInfo
1418 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001419}
1420
1421class VkCopyDescriptorSet {
1422 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1423 const void* pNext /// Pointer to next structure
1424 VkDescriptorSet srcSet /// Source descriptor set
1425 u32 srcBinding /// Binding within the source descriptor set to copy from
1426 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001427 VkDescriptorSet dstSet /// Destination descriptor set
1428 u32 dstBinding /// Binding within the destination descriptor set to copy to
1429 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001430 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001431}
1432
1433class VkBufferCreateInfo {
1434 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1435 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001436 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001437 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001438 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001439 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001440 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001441 const u32* pQueueFamilyIndices
1442}
1443
1444class VkBufferViewCreateInfo {
1445 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1446 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001447 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001448 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001449 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001450 VkDeviceSize offset /// Specified in bytes
1451 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001452}
1453
1454class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001455 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001456 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001457 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001458}
1459
1460class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001461 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001462 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001463 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001464 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001465 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001466}
1467
1468class VkMemoryBarrier {
1469 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1470 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001471 VkAccessFlags srcAccessMask
1472 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001473}
1474
1475class VkBufferMemoryBarrier {
1476 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1477 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001478 VkAccessFlags srcAccessMask
1479 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001480 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001481 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001482 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001483 VkDeviceSize offset /// Offset within the buffer to sync
1484 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001485}
1486
1487class VkImageMemoryBarrier {
1488 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1489 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001490 VkAccessFlags srcAccessMask
1491 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001492 VkImageLayout oldLayout /// Current layout of the image
1493 VkImageLayout newLayout /// New layout to transition the image to
1494 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001495 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001496 VkImage image /// Image to sync
1497 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1498}
1499
1500class VkImageCreateInfo {
1501 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1502 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001503 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001504 VkImageType imageType
1505 VkFormat format
1506 VkExtent3D extent
1507 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001508 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001509 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001510 VkImageTiling tiling
1511 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001512 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001513 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001514 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001515 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001516}
1517
1518class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001519 VkDeviceSize offset /// Specified in bytes
1520 VkDeviceSize size /// Specified in bytes
1521 VkDeviceSize rowPitch /// Specified in bytes
1522 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001523}
1524
1525class VkImageViewCreateInfo {
1526 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1527 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001528 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001529 VkImage image
1530 VkImageViewType viewType
1531 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001532 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001533 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001534}
1535
1536class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001537 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001538 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001539 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001540}
1541
Jesse Halla6429252015-11-29 18:59:42 -08001542class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001543 VkDeviceSize resourceOffset /// Specified in bytes
1544 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001545 VkDeviceMemory memory
1546 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001547 VkSparseMemoryBindFlags flags
1548}
1549
Jesse Halla6429252015-11-29 18:59:42 -08001550class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001551 VkImageSubresource subresource
1552 VkOffset3D offset
1553 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001554 VkDeviceMemory memory
1555 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001556 VkSparseMemoryBindFlags flags
1557}
1558
Jesse Halla6429252015-11-29 18:59:42 -08001559class VkSparseBufferMemoryBindInfo {
1560 VkBuffer buffer
1561 u32 bindCount
1562 const VkSparseMemoryBind* pBinds
1563}
1564
1565class VkSparseImageOpaqueMemoryBindInfo {
1566 VkImage image
1567 u32 bindCount
1568 const VkSparseMemoryBind* pBinds
1569}
1570
1571class VkSparseImageMemoryBindInfo {
1572 VkImage image
1573 u32 bindCount
1574 const VkSparseMemoryBind* pBinds
1575}
1576
1577class VkBindSparseInfo {
1578 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1579 const void* pNext
1580 u32 waitSemaphoreCount
1581 const VkSemaphore* pWaitSemaphores
1582 u32 numBufferBinds
1583 const VkSparseBufferMemoryBindInfo* pBufferBinds
1584 u32 numImageOpaqueBinds
1585 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1586 u32 numImageBinds
1587 const VkSparseImageMemoryBindInfo* pImageBinds
1588 u32 signalSemaphoreCount
1589 const VkSemaphore* pSignalSemaphores
1590}
1591
Jesse Hall65ab5522015-11-30 00:07:16 -08001592class VkImageSubresourceLayers {
1593 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001594 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001595 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001596 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001597}
1598
Jesse Halld27f6aa2015-08-15 17:58:48 -07001599class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001600 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001601 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001602 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001603 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001604 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1605}
1606
1607class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001608 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001609 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
1610 VkExtent3D srcExtent /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001611 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001612 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
1613 VkExtent3D dstExtent /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001614}
1615
1616class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001617 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001618 u32 bufferRowLength /// Specified in texels
1619 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001620 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001621 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1622 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1623}
1624
1625class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001626 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001627 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001628 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001629 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001630 VkExtent3D extent
1631}
1632
1633class VkShaderModuleCreateInfo {
1634 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1635 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001636 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001637 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08001638 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07001639}
1640
Jesse Halld27f6aa2015-08-15 17:58:48 -07001641class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08001642 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001643 VkDescriptorType descriptorType /// Type of the descriptors in this binding
1644 u32 arraySize /// Number of descriptors in this binding
1645 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
1646 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
1647}
1648
1649class VkDescriptorSetLayoutCreateInfo {
1650 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
1651 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001652 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001653 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001654 const VkDescriptorSetLayoutBinding* pBinding /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001655}
1656
Jesse Hall65ab5522015-11-30 00:07:16 -08001657class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001658 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08001659 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001660}
1661
1662class VkDescriptorPoolCreateInfo {
1663 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
1664 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08001665 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001666 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08001667 u32 poolSizeCount
1668 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001669}
1670
Jesse Hall3fbc8562015-11-29 22:10:52 -08001671class VkDescriptorSetAllocateInfo {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001672 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOC_INFO
1673 const void* pNext /// Pointer to next structure
1674 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08001675 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001676 const VkDescriptorSetLayout* pSetLayouts
1677}
1678
Jesse Halld27f6aa2015-08-15 17:58:48 -07001679class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08001680 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07001681 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08001682 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07001683}
1684
1685class VkSpecializationInfo {
1686 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08001687 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07001688 platform.size_t dataSize /// Size in bytes of pData
1689 const void* pData /// Pointer to SpecConstant data
1690}
1691
1692class VkPipelineShaderStageCreateInfo {
1693 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
1694 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001695 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001696 VkShaderStageFlagBits stage
1697 VkShaderModule module
1698 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07001699 const VkSpecializationInfo* pSpecializationInfo
1700}
1701
1702class VkComputePipelineCreateInfo {
1703 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
1704 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001705 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001706 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001707 VkPipelineLayout layout /// Interface layout of the pipeline
1708 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
1709 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
1710}
1711
1712class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001713 u32 binding /// Vertex buffer binding id
1714 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08001715 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07001716}
1717
1718class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001719 u32 location /// location of the shader vertex attrib
1720 u32 binding /// Vertex buffer binding id
1721 VkFormat format /// format of source data
1722 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001723}
1724
1725class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001726 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
1727 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001728 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001729 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001730 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08001731 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001732 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1733}
1734
1735class VkPipelineInputAssemblyStateCreateInfo {
1736 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
1737 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001738 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001739 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001740 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001741}
1742
1743class VkPipelineTessellationStateCreateInfo {
1744 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
1745 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001746 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001747 u32 patchControlPoints
1748}
1749
1750class VkPipelineViewportStateCreateInfo {
1751 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
1752 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001753 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001754 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001755 const VkViewport* pViewports
1756 u32 scissorCount
1757 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07001758}
1759
Jesse Hall3fbc8562015-11-29 22:10:52 -08001760class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08001761 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001762 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001763 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001764 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001765 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001766 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08001767 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07001768 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001769 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08001770 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001771 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08001772 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001773 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001774}
1775
1776class VkPipelineMultisampleStateCreateInfo {
1777 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
1778 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001779 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001780 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001781 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001782 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001783 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08001784 VkBool32 alphaToCoverageEnable
1785 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001786}
1787
1788class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001789 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001790 VkBlendFactor srcColorBlendFactor
1791 VkBlendFactor dstColorBlendFactor
1792 VkBlendOp colorBlendOp
1793 VkBlendFactor srcAlphaBlendFactor
1794 VkBlendFactor dstAlphaBlendFactor
1795 VkBlendOp alphaBlendOp
1796 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001797}
1798
1799class VkPipelineColorBlendStateCreateInfo {
1800 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
1801 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001802 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001803 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001804 VkLogicOp logicOp
1805 u32 attachmentCount /// # of pAttachments
1806 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08001807 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07001808}
1809
1810class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08001811 VkStencilOp failOp
1812 VkStencilOp passOp
1813 VkStencilOp depthFailOp
1814 VkCompareOp compareOp
1815 u32 compareMask
1816 u32 writeMask
1817 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07001818}
1819
1820class VkPipelineDepthStencilStateCreateInfo {
1821 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
1822 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001823 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001824 VkBool32 depthTestEnable
1825 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001826 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001827 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
1828 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001829 VkStencilOpState front
1830 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001831 f32 minDepthBounds
1832 f32 maxDepthBounds
1833}
1834
1835class VkPipelineDynamicStateCreateInfo {
1836 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
1837 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001838 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001839 u32 dynamicStateCount
1840 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001841}
1842
1843class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08001844 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
1845 const void* pNext /// Pointer to next structure
1846 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001847 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08001848 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001849 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
1850 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
1851 const VkPipelineTessellationStateCreateInfo* pTessellationState
1852 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08001853 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07001854 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
1855 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
1856 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001857 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08001858 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001859 VkRenderPass renderPass
1860 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08001861 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
1862 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 -07001863}
1864
1865class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08001866 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
1867 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001868 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08001869 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
1870 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07001871}
1872
1873class VkPushConstantRange {
1874 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08001875 u32 offset /// Start of the range, in bytes
1876 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001877}
1878
1879class VkPipelineLayoutCreateInfo {
1880 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
1881 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001882 VkPipelineLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001883 u32 setLayoutCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001884 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
1885 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
1886 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
1887}
1888
1889class VkSamplerCreateInfo {
1890 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
1891 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001892 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08001893 VkFilter magFilter /// Filter mode for magnification
1894 VkFilter minFilter /// Filter mode for minifiation
1895 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
1896 VkSamplerAddressMode addressModeU
1897 VkSamplerAddressMode addressModeV
1898 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07001899 f32 mipLodBias
1900 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001901 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001902 VkCompareOp compareOp
1903 f32 minLod
1904 f32 maxLod
1905 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001906 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001907}
1908
Jesse Hall3fbc8562015-11-29 22:10:52 -08001909class VkCommandPoolCreateInfo {
1910 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001911 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001912 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001913 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001914}
1915
Jesse Hall3fbc8562015-11-29 22:10:52 -08001916class VkCommandBufferAllocateInfo {
1917 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOC_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001918 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001919 VkCommandPool commandPool
1920 VkCommandBufferLevel level
Jesse Hall03b6fe12015-11-24 12:44:21 -08001921 u32 bufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001922}
1923
Jesse Hall3fbc8562015-11-29 22:10:52 -08001924class VkCommandBufferBeginInfo {
1925 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001926 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001927 VkCommandBufferUsageFlags flags /// Command buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001928 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001929 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07001930 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
1931}
1932
1933class VkRenderPassBeginInfo {
1934 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
1935 const void* pNext /// Pointer to next structure
1936 VkRenderPass renderPass
1937 VkFramebuffer framebuffer
1938 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001939 u32 clearValueCount
1940 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07001941}
1942
1943@union
1944/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
1945class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001946 f32[4] float32
1947 s32[4] int32
1948 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07001949}
1950
1951class VkClearDepthStencilValue {
1952 f32 depth
1953 u32 stencil
1954}
1955
1956@union
1957/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
1958class VkClearValue {
1959 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001960 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07001961}
1962
Jesse Hallae38f732015-11-19 21:32:50 -08001963class VkClearAttachment {
1964 VkImageAspectFlags aspectMask
1965 u32 colorAttachment
1966 VkClearValue clearValue
1967}
1968
Jesse Halld27f6aa2015-08-15 17:58:48 -07001969class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08001970 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001971 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08001972 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001973 VkAttachmentLoadOp loadOp /// Load op for color or depth data
1974 VkAttachmentStoreOp storeOp /// Store op for color or depth data
1975 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
1976 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
1977 VkImageLayout initialLayout
1978 VkImageLayout finalLayout
1979}
1980
1981class VkAttachmentReference {
1982 u32 attachment
1983 VkImageLayout layout
1984}
1985
1986class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001987 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08001988 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08001989 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001990 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08001991 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001992 const VkAttachmentReference* pColorAttachments
1993 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08001994 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08001995 u32 preserveAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001996 const VkAttachmentReference* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07001997}
1998
1999class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002000 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002001 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002002 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002003 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002004 VkAccessFlags srcAccessMask
2005 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002006 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002007}
2008
2009class VkRenderPassCreateInfo {
2010 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2011 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002012 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002013 u32 attachmentCount
2014 const VkAttachmentDescription* pAttachments
2015 u32 subpassCount
2016 const VkSubpassDescription* pSubpasses
2017 u32 dependencyCount
2018 const VkSubpassDependency* pDependencies
2019}
2020
2021class VkEventCreateInfo {
2022 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2023 const void* pNext /// Pointer to next structure
2024 VkEventCreateFlags flags /// Event creation flags
2025}
2026
2027class VkFenceCreateInfo {
2028 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2029 const void* pNext /// Pointer to next structure
2030 VkFenceCreateFlags flags /// Fence creation flags
2031}
2032
2033class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002034 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2035 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2036 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2037 VkBool32 independentBlend /// blending operations are controlled per-attachment
2038 VkBool32 geometryShader /// geometry stage
2039 VkBool32 tessellationShader /// tessellation control and evaluation stage
2040 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002041 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002042 VkBool32 logicOp /// logic operations
2043 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hallae38f732015-11-19 21:32:50 -08002044 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002045 VkBool32 depthBiasClamp /// depth bias clamping
2046 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2047 VkBool32 depthBounds /// depth bounds test
2048 VkBool32 wideLines /// lines with width greater than 1
2049 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002050 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2051 VkBool32 multiViewport
2052 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002053 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2054 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2055 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002056 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002057 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002058 VkBool32 vertexPipelineStoresAndAtomics
2059 VkBool32 fragmentStoresAndAtomics
2060 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002061 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2062 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2063 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002064 VkBool32 shaderStorageImageReadWithoutFormat
2065 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002066 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2067 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2068 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2069 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2070 VkBool32 shaderClipDistance /// clip distance in shaders
2071 VkBool32 shaderCullDistance /// cull distance in shaders
2072 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2073 VkBool32 shaderInt64 /// 64-bit integers in shaders
2074 VkBool32 shaderInt16 /// 16-bit integers in shaders
2075 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002076 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002077 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2078 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2079 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2080 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2081 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2082 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2083 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2084 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2085 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002086 VkBool32 variableMultisampleRate
Jesse Halld27f6aa2015-08-15 17:58:48 -07002087}
2088
2089class VkPhysicalDeviceLimits {
2090 /// resource maximum sizes
2091 u32 maxImageDimension1D /// max 1D image dimension
2092 u32 maxImageDimension2D /// max 2D image dimension
2093 u32 maxImageDimension3D /// max 3D image dimension
2094 u32 maxImageDimensionCube /// max cubemap image dimension
2095 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002096 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002097 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2098 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002099 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2100 /// memory limits
2101 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002102 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002103 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2104 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002105 /// descriptor set limits
2106 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002107 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2108 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2109 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2110 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2111 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
2112 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2113 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002114 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002115 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002116 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002117 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2118 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
2119 /// vertex stage limits
2120 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002121 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002122 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2123 u32 maxVertexInputBindingStride /// max vertex input binding stride
2124 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2125 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002126 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002127 u32 maxTessellationPatchSize /// max patch size (vertices)
2128 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2129 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2130 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2131 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2132 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2133 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002134 /// geometry stage limits
2135 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2136 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2137 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2138 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2139 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2140 /// fragment stage limits
2141 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002142 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002143 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002144 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2145 /// compute stage limits
2146 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2147 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2148 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2149 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2150
2151 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2152 u32 subTexelPrecisionBits /// num bits of subtexel precision
2153 u32 mipmapPrecisionBits /// num bits of mipmap precision
2154
2155 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
2156 u32 maxDrawIndirectInstanceCount /// max instance count for indirect draw calls
Jesse Halld27f6aa2015-08-15 17:58:48 -07002157
2158 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2159 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2160
2161 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002162 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2163 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2164 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2165
Jesse Halldc6d36c2015-11-29 19:12:15 -08002166 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2167 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2168 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2169 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002170
Jesse Hallfbf97b02015-11-20 14:17:03 -08002171 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002172 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002173 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002174 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2175 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2176 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2177 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2178
2179 u32 maxFramebufferWidth /// max width for a framebuffer
2180 u32 maxFramebufferHeight /// max height for a framebuffer
2181 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002182 VkSampleCountFlags framebufferColorSampleCounts
2183 VkSampleCountFlags framebufferDepthSampleCounts
2184 VkSampleCountFlags framebufferStencilSampleCounts
2185 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002186 u32 maxColorAttachments /// max num of framebuffer color attachments
2187
Jesse Hall091ed9e2015-11-30 00:55:29 -08002188 VkSampleCountFlags sampledImageColorSampleCounts
2189 VkSampleCountFlags sampledImageIntegerSampleCounts
2190 VkSampleCountFlags sampledImageDepthSampleCounts
2191 VkSampleCountFlags sampledImageStencilSampleCounts
2192 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002193 u32 maxSampleMaskWords /// max num of sample mask words
2194
Jesse Halla9bb62b2015-11-21 19:31:56 -08002195 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002196
2197 u32 maxClipDistances /// max number of clip distances
2198 u32 maxCullDistances /// max number of cull distances
2199 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2200
Jesse Hallfbf97b02015-11-20 14:17:03 -08002201 u32 discreteQueuePriorities
2202
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002203 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2204 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002205 f32 pointSizeGranularity /// granularity of supported point sizes
2206 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002207 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002208 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002209
Jesse Hall65ab5522015-11-30 00:07:16 -08002210 VkDeviceSize optimalBufferCopyOffsetAlignment
2211 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07002212}
2213
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002214class VkPhysicalDeviceSparseProperties {
2215 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 -08002216 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 -07002217 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2218 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 -07002219 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
2220}
2221
Jesse Halld27f6aa2015-08-15 17:58:48 -07002222class VkSemaphoreCreateInfo {
2223 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2224 const void* pNext /// Pointer to next structure
2225 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2226}
2227
2228class VkQueryPoolCreateInfo {
2229 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2230 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002231 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002232 VkQueryType queryType
Jesse Hall65ab5522015-11-30 00:07:16 -08002233 u32 entryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002234 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2235}
2236
2237class VkFramebufferCreateInfo {
2238 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2239 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002240 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002241 VkRenderPass renderPass
2242 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002243 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002244 u32 width
2245 u32 height
2246 u32 layers
2247}
2248
Jesse Hall3fbc8562015-11-29 22:10:52 -08002249class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002250 u32 vertexCount
2251 u32 instanceCount
2252 u32 firstVertex
2253 u32 firstInstance
2254}
2255
Jesse Hall3fbc8562015-11-29 22:10:52 -08002256class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002257 u32 indexCount
2258 u32 instanceCount
2259 u32 firstIndex
2260 s32 vertexOffset
2261 u32 firstInstance
2262}
2263
Jesse Hall3fbc8562015-11-29 22:10:52 -08002264class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002265 u32 x
2266 u32 y
2267 u32 z
2268}
2269
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002270@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002271class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002272 u32 minImageCount
2273 u32 maxImageCount
2274 VkExtent2D currentExtent
2275 VkExtent2D minImageExtent
2276 VkExtent2D maxImageExtent
2277 VkSurfaceTransformFlagsKHR supportedTransforms
2278 VkSurfaceTransformKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002279 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002280 u32 maxImageArraySize
2281 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002282}
2283
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002284@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002285class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002286 VkFormat format
2287 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002288}
2289
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002290@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002291class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002292 VkStructureType sType
2293 const void* pNext
2294 VkSurfaceKHR surface
2295 u32 minImageCount
2296 VkFormat imageFormat
2297 VkColorSpaceKHR imageColorSpace
2298 VkExtent2D imageExtent
2299 VkImageUsageFlags imageUsageFlags
2300 VkSurfaceTransformKHR preTransform
Jesse Halla6429252015-11-29 18:59:42 -08002301 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002302 u32 imageArraySize
2303 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002304 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002305 const u32* pQueueFamilyIndices
2306 VkPresentModeKHR presentMode
2307 VkSwapchainKHR oldSwapchain
2308 VkBool32 clipped
Michael Lentine88594d72015-11-12 12:49:45 -08002309}
2310
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002311@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002312class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002313 VkStructureType sType
2314 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002315 u32 waitSemaphoreCount
2316 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002317 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002318 const VkSwapchainKHR* pSwapchains
Jesse Hall1356b0d2015-11-23 17:24:58 -08002319 const u32* imageIndices
Michael Lentine88594d72015-11-12 12:49:45 -08002320}
2321
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002322@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002323class VkDisplayPropertiesKHR {
2324 VkDisplayKHR display
2325 const char* displayName
2326 VkExtent2D physicalDimensions
2327 VkExtent2D physicalResolution
2328 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002329 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002330 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002331}
2332
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002333@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002334class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002335 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002336 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002337}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002338
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002339@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002340class VkDisplayModePropertiesKHR {
2341 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002342 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002343}
2344
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002345@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002346class VkDisplayModeCreateInfoKHR {
2347 VkStructureType sType
2348 const void* pNext
Jesse Halla6429252015-11-29 18:59:42 -08002349 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002350}
2351
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002352@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002353class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002354 VkDisplayKHR currentDisplay
2355 u32 currentStackIndex
2356}
2357
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002358@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002359class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002360 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2361 VkOffset2D minSrcPosition
2362 VkOffset2D maxSrcPosition
2363 VkExtent2D minSrcExtent
2364 VkExtent2D maxSrcExtent
2365 VkOffset2D minDstPosition
2366 VkOffset2D maxDstPosition
2367 VkExtent2D minDstExtent
2368 VkExtent2D maxDstExtent
2369}
2370
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002371@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002372class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002373 VkStructureType sType
2374 const void* pNext
2375 VkDisplayModeKHR displayMode
2376 u32 planeIndex
2377 u32 planeStackIndex
2378 VkSurfaceTransformKHR transform
2379 f32 globalAlpha
2380 VkDisplayPlaneAlphaFlagsKHR alphaMode
2381 VkExtent2D imageSize
2382}
2383
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002384@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002385class VkDisplaySwapchainCreateInfoKHR {
2386 VkStructureType sType
2387 const void* pNext
2388 const VkSwapchainCreateInfoKHR* pNextSwapchainCreateInfo
2389}
2390
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002391@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002392class VkDisplayPresentInfoKHR {
2393 VkStructureType sType
2394 const void* pNext
2395 VkRect2D srcRect
2396 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002397 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002398}
2399
2400
Jesse Halld27f6aa2015-08-15 17:58:48 -07002401////////////////
2402// Commands //
2403////////////////
2404
2405// Function pointers. TODO: add support for function pointers.
2406
2407@external type void* PFN_vkVoidFunction
2408@pfn cmd void vkVoidFunction() {
2409}
2410
Jesse Hall3fbc8562015-11-29 22:10:52 -08002411@external type void* PFN_vkAllocationFunction
2412@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002413 void* pUserData,
2414 platform.size_t size,
2415 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002416 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002417 return ?
2418}
2419
Jesse Hall3fbc8562015-11-29 22:10:52 -08002420@external type void* PFN_vkReallocationFunction
2421@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002422 void* pUserData,
2423 void* pOriginal,
2424 platform.size_t size,
2425 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002426 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002427 return ?
2428}
2429
2430@external type void* PFN_vkFreeFunction
2431@pfn cmd void vkFreeFunction(
2432 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002433 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002434}
2435
Jesse Hall3fbc8562015-11-29 22:10:52 -08002436@external type void* PFN_vkInternalAllocationNotification
2437@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002438 void* pUserData,
2439 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002440 VkInternalAllocationType allocationType,
2441 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002442}
2443
2444@external type void* PFN_vkInternalFreeNotification
2445@pfn cmd void vkInternalFreeNotification(
2446 void* pUserData,
2447 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002448 VkInternalAllocationType allocationType,
2449 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002450}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002451
2452// Global functions
2453
2454@threadSafety("system")
2455cmd VkResult vkCreateInstance(
2456 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002457 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002458 VkInstance* pInstance) {
2459 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
2460
2461 instance := ?
2462 pInstance[0] = instance
2463 State.Instances[instance] = new!InstanceObject()
2464
Jesse Hall03b6fe12015-11-24 12:44:21 -08002465 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerNameCount]
2466 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionNameCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07002467
2468 return ?
2469}
2470
2471@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002472cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002473 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002474 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002475 instanceObject := GetInstance(instance)
2476
2477 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002478}
2479
2480@threadSafety("system")
2481cmd VkResult vkEnumeratePhysicalDevices(
2482 VkInstance instance,
2483 u32* pPhysicalDeviceCount,
2484 VkPhysicalDevice* pPhysicalDevices) {
2485 instanceObject := GetInstance(instance)
2486
2487 physicalDeviceCount := as!u32(?)
2488 pPhysicalDeviceCount[0] = physicalDeviceCount
2489 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
2490
2491 for i in (0 .. physicalDeviceCount) {
2492 physicalDevice := ?
2493 physicalDevices[i] = physicalDevice
2494 if !(physicalDevice in State.PhysicalDevices) {
2495 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
2496 }
2497 }
2498
2499 return ?
2500}
2501
2502cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
2503 VkDevice device,
2504 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002505 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002506 device := GetDevice(device)
2507 }
2508
2509 return ?
2510}
2511
2512cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
2513 VkInstance instance,
2514 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002515 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002516 instanceObject := GetInstance(instance)
2517 }
2518
2519 return ?
2520}
2521
Jesse Hall606a54e2015-11-19 22:17:28 -08002522cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002523 VkPhysicalDevice physicalDevice,
2524 VkPhysicalDeviceProperties* pProperties) {
2525 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2526
2527 properties := ?
2528 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002529}
2530
Jesse Hall606a54e2015-11-19 22:17:28 -08002531cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002532 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002533 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002534 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002535 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002536 // TODO: Figure out how to express fetch-count-or-properties
2537 // This version fails 'apic validate' with 'fence not allowed in
2538 // *semantic.Branch'. Other attempts have failed with the same or other
2539 // errors.
2540 // if pQueueFamilyProperties != null {
2541 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
2542 // for i in (0 .. pCount[0]) {
2543 // queueProperties := as!VkQueueFamilyProperties(?)
2544 // queuesProperties[i] = queueProperties
2545 // }
2546 // } else {
2547 // count := ?
2548 // pCount[0] = count
2549 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002550}
2551
Jesse Hall606a54e2015-11-19 22:17:28 -08002552cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002553 VkPhysicalDevice physicalDevice,
2554 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
2555 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2556
2557 memoryProperties := ?
2558 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002559}
2560
Jesse Hall606a54e2015-11-19 22:17:28 -08002561cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002562 VkPhysicalDevice physicalDevice,
2563 VkPhysicalDeviceFeatures* pFeatures) {
2564 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2565
2566 features := ?
2567 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07002568}
2569
Jesse Hall606a54e2015-11-19 22:17:28 -08002570cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002571 VkPhysicalDevice physicalDevice,
2572 VkFormat format,
2573 VkFormatProperties* pFormatProperties) {
2574 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2575
2576 formatProperties := ?
2577 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002578}
2579
Jesse Hall606a54e2015-11-19 22:17:28 -08002580cmd void vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002581 VkPhysicalDevice physicalDevice,
2582 VkFormat format,
2583 VkImageType type,
2584 VkImageTiling tiling,
2585 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002586 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002587 VkImageFormatProperties* pImageFormatProperties) {
2588 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2589
2590 imageFormatProperties := ?
2591 pImageFormatProperties[0] = imageFormatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002592}
2593
Jesse Halld27f6aa2015-08-15 17:58:48 -07002594
2595// Device functions
2596
2597@threadSafety("system")
2598cmd VkResult vkCreateDevice(
2599 VkPhysicalDevice physicalDevice,
2600 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002601 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002602 VkDevice* pDevice) {
2603 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
2604 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2605
2606 device := ?
2607 pDevice[0] = device
2608 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
2609
2610 return ?
2611}
2612
2613@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002614cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002615 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002616 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002617 deviceObject := GetDevice(device)
2618
2619 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002620}
2621
2622
2623// Extension discovery functions
2624
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002625cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002626 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002627 VkLayerProperties* pProperties) {
2628 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002629 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002630
2631 properties := pProperties[0:count]
2632 for i in (0 .. count) {
2633 property := ?
2634 properties[i] = property
2635 }
2636
2637 return ?
2638}
2639
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002640cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002641 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002642 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002643 VkExtensionProperties* pProperties) {
2644 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002645 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002646
2647 properties := pProperties[0:count]
2648 for i in (0 .. count) {
2649 property := ?
2650 properties[i] = property
2651 }
2652
2653 return ?
2654}
2655
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002656cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002657 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002658 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002659 VkLayerProperties* pProperties) {
2660 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2661 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002662 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002663
2664 properties := pProperties[0:count]
2665 for i in (0 .. count) {
2666 property := ?
2667 properties[i] = property
2668 }
2669
2670 return ?
2671}
2672
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002673cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002674 VkPhysicalDevice physicalDevice,
2675 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002676 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002677 VkExtensionProperties* pProperties) {
2678 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2679
2680 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002681 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002682
2683 properties := pProperties[0:count]
2684 for i in (0 .. count) {
2685 property := ?
2686 properties[i] = property
2687 }
2688
2689 return ?
2690}
2691
2692
2693// Queue functions
2694
2695@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08002696cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002697 VkDevice device,
2698 u32 queueFamilyIndex,
2699 u32 queueIndex,
2700 VkQueue* pQueue) {
2701 deviceObject := GetDevice(device)
2702
2703 queue := ?
2704 pQueue[0] = queue
2705
2706 if !(queue in State.Queues) {
2707 State.Queues[queue] = new!QueueObject(device: device)
2708 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002709}
2710
2711@threadSafety("app")
2712cmd VkResult vkQueueSubmit(
2713 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08002714 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08002715 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002716 VkFence fence) {
2717 queueObject := GetQueue(queue)
2718
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002719 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002720 fenceObject := GetFence(fence)
2721 assert(fenceObject.device == queueObject.device)
2722 }
2723
Jesse Hall3fbc8562015-11-29 22:10:52 -08002724 // commandBuffers := pcommandBuffers[0:commandBufferCount]
2725 // for i in (0 .. commandBufferCount) {
2726 // commandBuffer := commandBuffers[i]
2727 // commandBufferObject := GetCommandBuffer(commandBuffer)
2728 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08002729 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08002730 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
2731 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08002732 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002733
2734 return ?
2735}
2736
2737@threadSafety("system")
2738cmd VkResult vkQueueWaitIdle(
2739 VkQueue queue) {
2740 queueObject := GetQueue(queue)
2741
2742 return ?
2743}
2744
2745@threadSafety("system")
2746cmd VkResult vkDeviceWaitIdle(
2747 VkDevice device) {
2748 deviceObject := GetDevice(device)
2749
2750 return ?
2751}
2752
2753
2754// Memory functions
2755
2756@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002757cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002758 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002759 const VkMemoryAllocateInfo* pAllocateInfo,
2760 const VkAllocationCallbacks* pAllocator,
2761 VkDeviceMemory* pMemory) {
2762 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002763 deviceObject := GetDevice(device)
2764
Jesse Hall3fbc8562015-11-29 22:10:52 -08002765 memory := ?
2766 pMemory[0] = memory
2767 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002768 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002769 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002770
2771 return ?
2772}
2773
2774@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002775cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002776 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002777 VkDeviceMemory memory,
2778 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002779 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002780 memoryObject := GetDeviceMemory(memory)
2781 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002782
2783 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08002784 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002785 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002786 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
2787 "vkFreeMemory: commandBuffers still bound")
2788 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002789}
2790
2791@threadSafety("app")
2792cmd VkResult vkMapMemory(
2793 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002794 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002795 VkDeviceSize offset,
2796 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002797 VkMemoryMapFlags flags,
2798 void** ppData) {
2799 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002800 memoryObject := GetDeviceMemory(memory)
2801 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002802
2803 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08002804 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002805
2806 return ?
2807}
2808
2809@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002810cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002811 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002812 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002813 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002814 memoryObject := GetDeviceMemory(memory)
2815 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002816}
2817
2818cmd VkResult vkFlushMappedMemoryRanges(
2819 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002820 u32 memoryRangeCount
2821 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002822 deviceObject := GetDevice(device)
2823
Jesse Hall3fbc8562015-11-29 22:10:52 -08002824 memoryRanges := pMemoryRanges[0:memoryRangeCount]
2825 for i in (0 .. memoryRangeCount) {
2826 memoryRange := memoryRanges[i]
2827 memoryObject := GetDeviceMemory(memoryRange.memory)
2828 assert(memoryObject.device == device)
2829 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002830 }
2831
2832 return ?
2833}
2834
2835cmd VkResult vkInvalidateMappedMemoryRanges(
2836 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002837 u32 memoryRangeCount,
2838 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002839 deviceObject := GetDevice(device)
2840
Jesse Hall3fbc8562015-11-29 22:10:52 -08002841 memoryRanges := pMemoryRanges[0:memoryRangeCount]
2842 for i in (0 .. memoryRangeCount) {
2843 memoryRange := memoryRanges[i]
2844 memoryObject := GetDeviceMemory(memoryRange.memory)
2845 assert(memoryObject.device == device)
2846 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002847 }
2848
2849 return ?
2850}
2851
2852
2853// Memory management API functions
2854
Jesse Hall606a54e2015-11-19 22:17:28 -08002855cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002856 VkDevice device,
2857 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002858 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002859 deviceObject := GetDevice(device)
2860
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002861 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002862 memoryObject := GetDeviceMemory(memory)
2863 assert(memoryObject.device == device)
2864 }
2865
2866 committedMemoryInBytes := ?
2867 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002868}
2869
Jesse Hall606a54e2015-11-19 22:17:28 -08002870cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002871 VkDevice device,
2872 VkBuffer buffer,
2873 VkMemoryRequirements* pMemoryRequirements) {
2874 deviceObject := GetDevice(device)
2875 bufferObject := GetBuffer(buffer)
2876 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002877}
2878
2879cmd VkResult vkBindBufferMemory(
2880 VkDevice device,
2881 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002882 VkDeviceMemory memory,
2883 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002884 deviceObject := GetDevice(device)
2885 bufferObject := GetBuffer(buffer)
2886 assert(bufferObject.device == device)
2887
2888 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08002889 if bufferObject.memory != NULL_HANDLE {
2890 memoryObject := GetDeviceMemory(bufferObject.memory)
2891 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002892 }
2893
2894 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08002895 if memory != NULL_HANDLE {
2896 memoryObject := GetDeviceMemory(memory)
2897 assert(memoryObject.device == device)
2898 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002899 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08002900 bufferObject.memory = memory
2901 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002902
2903 return ?
2904}
2905
Jesse Hall606a54e2015-11-19 22:17:28 -08002906cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002907 VkDevice device,
2908 VkImage image,
2909 VkMemoryRequirements* pMemoryRequirements) {
2910 deviceObject := GetDevice(device)
2911 imageObject := GetImage(image)
2912 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002913}
2914
2915cmd VkResult vkBindImageMemory(
2916 VkDevice device,
2917 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002918 VkDeviceMemory memory,
2919 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002920 deviceObject := GetDevice(device)
2921 imageObject := GetImage(image)
2922 assert(imageObject.device == device)
2923
2924 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08002925 if imageObject.memory != NULL_HANDLE {
2926 memoryObject := GetDeviceMemory(imageObject.memory)
2927 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002928 }
2929
2930 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08002931 if memory != NULL_HANDLE {
2932 memoryObject := GetDeviceMemory(memory)
2933 assert(memoryObject.device == device)
2934 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002935 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08002936 imageObject.memory = memory
2937 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002938
2939 return ?
2940}
2941
Jesse Hall606a54e2015-11-19 22:17:28 -08002942cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002943 VkDevice device,
2944 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002945 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002946 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
2947 deviceObject := GetDevice(device)
2948 imageObject := GetImage(image)
2949 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002950}
2951
Jesse Hall606a54e2015-11-19 22:17:28 -08002952cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002953 VkPhysicalDevice physicalDevice,
2954 VkFormat format,
2955 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08002956 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002957 VkImageUsageFlags usage,
2958 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002959 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002960 VkSparseImageFormatProperties* pProperties) {
2961 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002962}
2963
Jesse Halla6429252015-11-29 18:59:42 -08002964cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002965 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002966 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08002967 const VkBindSparseInfo* pBindInfo,
2968 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002969 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002970
2971 return ?
2972}
2973
2974
2975// Fence functions
2976
2977@threadSafety("system")
2978cmd VkResult vkCreateFence(
2979 VkDevice device,
2980 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002981 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002982 VkFence* pFence) {
2983 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
2984 deviceObject := GetDevice(device)
2985
2986 fence := ?
2987 pFence[0] = fence
2988 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08002989 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07002990
2991 return ?
2992}
2993
2994@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002995cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002996 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002997 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002998 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002999 deviceObject := GetDevice(device)
3000 fenceObject := GetFence(fence)
3001 assert(fenceObject.device == device)
3002
3003 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003004}
3005
3006@threadSafety("system")
3007cmd VkResult vkResetFences(
3008 VkDevice device,
3009 u32 fenceCount,
3010 const VkFence* pFences) {
3011 deviceObject := GetDevice(device)
3012
3013 fences := pFences[0:fenceCount]
3014 for i in (0 .. fenceCount) {
3015 fence := fences[i]
3016 fenceObject := GetFence(fence)
3017 assert(fenceObject.device == device)
3018 fenceObject.signaled = false
3019 }
3020
3021 return ?
3022}
3023
3024@threadSafety("system")
3025cmd VkResult vkGetFenceStatus(
3026 VkDevice device,
3027 VkFence fence) {
3028 deviceObject := GetDevice(device)
3029 fenceObject := GetFence(fence)
3030 assert(fenceObject.device == device)
3031
3032 return ?
3033}
3034
3035@threadSafety("system")
3036cmd VkResult vkWaitForFences(
3037 VkDevice device,
3038 u32 fenceCount,
3039 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003040 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003041 u64 timeout) { /// timeout in nanoseconds
3042 deviceObject := GetDevice(device)
3043
3044 fences := pFences[0:fenceCount]
3045 for i in (0 .. fenceCount) {
3046 fence := fences[i]
3047 fenceObject := GetFence(fence)
3048 assert(fenceObject.device == device)
3049 }
3050
3051 return ?
3052}
3053
3054
3055// Queue semaphore functions
3056
3057@threadSafety("system")
3058cmd VkResult vkCreateSemaphore(
3059 VkDevice device,
3060 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003061 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003062 VkSemaphore* pSemaphore) {
3063 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3064 deviceObject := GetDevice(device)
3065
3066 semaphore := ?
3067 pSemaphore[0] = semaphore
3068 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3069
3070 return ?
3071}
3072
3073@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003074cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003075 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003076 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003077 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003078 deviceObject := GetDevice(device)
3079 semaphoreObject := GetSemaphore(semaphore)
3080 assert(semaphoreObject.device == device)
3081
3082 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003083}
3084
Jesse Halld27f6aa2015-08-15 17:58:48 -07003085
3086// Event functions
3087
3088@threadSafety("system")
3089cmd VkResult vkCreateEvent(
3090 VkDevice device,
3091 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003092 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003093 VkEvent* pEvent) {
3094 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3095 deviceObject := GetDevice(device)
3096
3097 event := ?
3098 pEvent[0] = event
3099 State.Events[event] = new!EventObject(device: device)
3100
3101 return ?
3102}
3103
3104@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003105cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003106 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003107 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003108 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003109 deviceObject := GetDevice(device)
3110 eventObject := GetEvent(event)
3111 assert(eventObject.device == device)
3112
3113 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003114}
3115
3116@threadSafety("system")
3117cmd VkResult vkGetEventStatus(
3118 VkDevice device,
3119 VkEvent event) {
3120 deviceObject := GetDevice(device)
3121 eventObject := GetEvent(event)
3122 assert(eventObject.device == device)
3123
3124 return ?
3125}
3126
3127@threadSafety("system")
3128cmd VkResult vkSetEvent(
3129 VkDevice device,
3130 VkEvent event) {
3131 deviceObject := GetDevice(device)
3132 eventObject := GetEvent(event)
3133 assert(eventObject.device == device)
3134
3135 return ?
3136}
3137
3138@threadSafety("system")
3139cmd VkResult vkResetEvent(
3140 VkDevice device,
3141 VkEvent event) {
3142 deviceObject := GetDevice(device)
3143 eventObject := GetEvent(event)
3144 assert(eventObject.device == device)
3145
3146 return ?
3147}
3148
3149
3150// Query functions
3151
3152@threadSafety("system")
3153cmd VkResult vkCreateQueryPool(
3154 VkDevice device,
3155 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003156 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003157 VkQueryPool* pQueryPool) {
3158 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3159 deviceObject := GetDevice(device)
3160
3161 queryPool := ?
3162 pQueryPool[0] = queryPool
3163 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3164
3165 return ?
3166}
3167
3168@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003169cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003170 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003171 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003172 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003173 deviceObject := GetDevice(device)
3174 queryPoolObject := GetQueryPool(queryPool)
3175 assert(queryPoolObject.device == device)
3176
3177 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003178}
3179
3180@threadSafety("system")
3181cmd VkResult vkGetQueryPoolResults(
3182 VkDevice device,
3183 VkQueryPool queryPool,
3184 u32 startQuery,
3185 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003186 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003187 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003188 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003189 VkQueryResultFlags flags) {
3190 deviceObject := GetDevice(device)
3191 queryPoolObject := GetQueryPool(queryPool)
3192 assert(queryPoolObject.device == device)
3193
Jesse Halld27f6aa2015-08-15 17:58:48 -07003194 data := pData[0:dataSize]
3195
3196 return ?
3197}
3198
3199// Buffer functions
3200
3201@threadSafety("system")
3202cmd VkResult vkCreateBuffer(
3203 VkDevice device,
3204 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003205 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003206 VkBuffer* pBuffer) {
3207 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3208 deviceObject := GetDevice(device)
3209
3210 buffer := ?
3211 pBuffer[0] = buffer
3212 State.Buffers[buffer] = new!BufferObject(device: device)
3213
3214 return ?
3215}
3216
3217@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003218cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003219 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003220 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003221 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003222 deviceObject := GetDevice(device)
3223 bufferObject := GetBuffer(buffer)
3224 assert(bufferObject.device == device)
3225
Jesse Hall3fbc8562015-11-29 22:10:52 -08003226 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003227 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003228}
3229
3230
3231// Buffer view functions
3232
3233@threadSafety("system")
3234cmd VkResult vkCreateBufferView(
3235 VkDevice device,
3236 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003237 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003238 VkBufferView* pView) {
3239 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3240 deviceObject := GetDevice(device)
3241
3242 bufferObject := GetBuffer(pCreateInfo.buffer)
3243 assert(bufferObject.device == device)
3244
3245 view := ?
3246 pView[0] = view
3247 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3248
3249 return ?
3250}
3251
3252@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003253cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003254 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003255 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003256 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003257 deviceObject := GetDevice(device)
3258 bufferViewObject := GetBufferView(bufferView)
3259 assert(bufferViewObject.device == device)
3260
3261 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003262}
3263
3264
3265// Image functions
3266
3267@threadSafety("system")
3268cmd VkResult vkCreateImage(
3269 VkDevice device,
3270 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003271 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003272 VkImage* pImage) {
3273 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3274 deviceObject := GetDevice(device)
3275
3276 image := ?
3277 pImage[0] = image
3278 State.Images[image] = new!ImageObject(device: device)
3279
3280 return ?
3281}
3282
3283@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003284cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003285 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003286 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003287 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003288 deviceObject := GetDevice(device)
3289 imageObject := GetImage(image)
3290 assert(imageObject.device == device)
3291
Jesse Hall3fbc8562015-11-29 22:10:52 -08003292 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003293 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003294}
3295
Jesse Hall606a54e2015-11-19 22:17:28 -08003296cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003297 VkDevice device,
3298 VkImage image,
3299 const VkImageSubresource* pSubresource,
3300 VkSubresourceLayout* pLayout) {
3301 deviceObject := GetDevice(device)
3302 imageObject := GetImage(image)
3303 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003304}
3305
3306
3307// Image view functions
3308
3309@threadSafety("system")
3310cmd VkResult vkCreateImageView(
3311 VkDevice device,
3312 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003313 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003314 VkImageView* pView) {
3315 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
3316 deviceObject := GetDevice(device)
3317
3318 imageObject := GetImage(pCreateInfo.image)
3319 assert(imageObject.device == device)
3320
3321 view := ?
3322 pView[0] = view
3323 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
3324
3325 return ?
3326}
3327
3328@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003329cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003330 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003331 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003332 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003333 deviceObject := GetDevice(device)
3334 imageViewObject := GetImageView(imageView)
3335 assert(imageViewObject.device == device)
3336
3337 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003338}
3339
3340
3341// Shader functions
3342
3343cmd VkResult vkCreateShaderModule(
3344 VkDevice device,
3345 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003346 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003347 VkShaderModule* pShaderModule) {
3348 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
3349 deviceObject := GetDevice(device)
3350
3351 shaderModule := ?
3352 pShaderModule[0] = shaderModule
3353 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
3354
3355 return ?
3356}
3357
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003358cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003359 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003360 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003361 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003362 deviceObject := GetDevice(device)
3363 shaderModuleObject := GetShaderModule(shaderModule)
3364 assert(shaderModuleObject.device == device)
3365
3366 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003367}
3368
Jesse Halld27f6aa2015-08-15 17:58:48 -07003369
3370// Pipeline functions
3371
3372cmd VkResult vkCreatePipelineCache(
3373 VkDevice device,
3374 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003375 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003376 VkPipelineCache* pPipelineCache) {
3377 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
3378 deviceObject := GetDevice(device)
3379
3380 pipelineCache := ?
3381 pPipelineCache[0] = pipelineCache
3382 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
3383
3384 return ?
3385}
3386
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003387cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003388 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003389 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003390 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003391 deviceObject := GetDevice(device)
3392 pipelineCacheObject := GetPipelineCache(pipelineCache)
3393 assert(pipelineCacheObject.device == device)
3394
3395 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003396}
3397
Jesse Halld27f6aa2015-08-15 17:58:48 -07003398cmd VkResult vkGetPipelineCacheData(
3399 VkDevice device,
3400 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003401 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003402 void* pData) {
3403 deviceObject := GetDevice(device)
3404 pipelineCacheObject := GetPipelineCache(pipelineCache)
3405 assert(pipelineCacheObject.device == device)
3406
3407 return ?
3408}
3409
3410cmd VkResult vkMergePipelineCaches(
3411 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003412 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003413 u32 srcCacheCount,
3414 const VkPipelineCache* pSrcCaches) {
3415 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003416 dstCacheObject := GetPipelineCache(dstCache)
3417 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003418
3419 srcCaches := pSrcCaches[0:srcCacheCount]
3420 for i in (0 .. srcCacheCount) {
3421 srcCache := srcCaches[i]
3422 srcCacheObject := GetPipelineCache(srcCache)
3423 assert(srcCacheObject.device == device)
3424 }
3425
3426 return ?
3427}
3428
3429cmd VkResult vkCreateGraphicsPipelines(
3430 VkDevice device,
3431 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003432 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003433 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003434 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003435 VkPipeline* pPipelines) {
3436 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003437 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003438 pipelineCacheObject := GetPipelineCache(pipelineCache)
3439 assert(pipelineCacheObject.device == device)
3440 }
3441
Jesse Hall03b6fe12015-11-24 12:44:21 -08003442 createInfos := pCreateInfos[0:createInfoCount]
3443 pipelines := pPipelines[0:createInfoCount]
3444 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003445 pipeline := ?
3446 pipelines[i] = pipeline
3447 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3448 }
3449
3450 return ?
3451}
3452
3453cmd VkResult vkCreateComputePipelines(
3454 VkDevice device,
3455 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003456 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003457 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003458 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003459 VkPipeline* pPipelines) {
3460 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003461 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003462 pipelineCacheObject := GetPipelineCache(pipelineCache)
3463 assert(pipelineCacheObject.device == device)
3464 }
3465
Jesse Hall03b6fe12015-11-24 12:44:21 -08003466 createInfos := pCreateInfos[0:createInfoCount]
3467 pipelines := pPipelines[0:createInfoCount]
3468 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003469 pipeline := ?
3470 pipelines[i] = pipeline
3471 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3472 }
3473
3474 return ?
3475}
3476
3477@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003478cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003479 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003480 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003481 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003482 deviceObject := GetDevice(device)
3483 pipelineObjects := GetPipeline(pipeline)
3484 assert(pipelineObjects.device == device)
3485
3486 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003487}
3488
3489
3490// Pipeline layout functions
3491
3492@threadSafety("system")
3493cmd VkResult vkCreatePipelineLayout(
3494 VkDevice device,
3495 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003496 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003497 VkPipelineLayout* pPipelineLayout) {
3498 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
3499 deviceObject := GetDevice(device)
3500
3501 pipelineLayout := ?
3502 pPipelineLayout[0] = pipelineLayout
3503 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
3504
3505 return ?
3506}
3507
3508@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003509cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003510 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003511 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003512 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003513 deviceObject := GetDevice(device)
3514 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
3515 assert(pipelineLayoutObjects.device == device)
3516
3517 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003518}
3519
3520
3521// Sampler functions
3522
3523@threadSafety("system")
3524cmd VkResult vkCreateSampler(
3525 VkDevice device,
3526 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003527 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003528 VkSampler* pSampler) {
3529 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
3530 deviceObject := GetDevice(device)
3531
3532 sampler := ?
3533 pSampler[0] = sampler
3534 State.Samplers[sampler] = new!SamplerObject(device: device)
3535
3536 return ?
3537}
3538
3539@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003540cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003541 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003542 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003543 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003544 deviceObject := GetDevice(device)
3545 samplerObject := GetSampler(sampler)
3546 assert(samplerObject.device == device)
3547
3548 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003549}
3550
3551
3552// Descriptor set functions
3553
3554@threadSafety("system")
3555cmd VkResult vkCreateDescriptorSetLayout(
3556 VkDevice device,
3557 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003558 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003559 VkDescriptorSetLayout* pSetLayout) {
3560 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
3561 deviceObject := GetDevice(device)
3562
3563 setLayout := ?
3564 pSetLayout[0] = setLayout
3565 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
3566
3567 return ?
3568}
3569
3570@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003571cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003572 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003573 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003574 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003575 deviceObject := GetDevice(device)
3576 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
3577 assert(descriptorSetLayoutObject.device == device)
3578
3579 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003580}
3581
3582@threadSafety("system")
3583cmd VkResult vkCreateDescriptorPool(
3584 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003585 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003586 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003587 VkDescriptorPool* pDescriptorPool) {
3588 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
3589 deviceObject := GetDevice(device)
3590
3591 descriptorPool := ?
3592 pDescriptorPool[0] = descriptorPool
3593 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
3594
3595 return ?
3596}
3597
3598@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003599cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003600 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003601 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003602 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003603 deviceObject := GetDevice(device)
3604 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3605 assert(descriptorPoolObject.device == device)
3606
3607 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003608}
3609
3610@threadSafety("app")
3611cmd VkResult vkResetDescriptorPool(
3612 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08003613 VkDescriptorPool descriptorPool,
3614 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003615 deviceObject := GetDevice(device)
3616 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3617 assert(descriptorPoolObject.device == device)
3618
3619 return ?
3620}
3621
3622@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003623cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003624 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003625 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003626 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003627 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003628 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003629 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003630
Jesse Hall03b6fe12015-11-24 12:44:21 -08003631 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
3632 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003633 setLayout := setLayouts[i]
3634 setLayoutObject := GetDescriptorSetLayout(setLayout)
3635 assert(setLayoutObject.device == device)
3636 }
3637
Jesse Hall03b6fe12015-11-24 12:44:21 -08003638 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
3639 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003640 descriptorSet := ?
3641 descriptorSets[i] = descriptorSet
3642 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
3643 }
3644
3645 return ?
3646}
3647
Jesse Hallf09c6b12015-08-15 19:54:28 -07003648cmd VkResult vkFreeDescriptorSets(
3649 VkDevice device,
3650 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003651 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07003652 const VkDescriptorSet* pDescriptorSets) {
3653 deviceObject := GetDevice(device)
3654 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3655
Jesse Hall03b6fe12015-11-24 12:44:21 -08003656 descriptorSets := pDescriptorSets[0:descriptorSetCount]
3657 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07003658 descriptorSet := descriptorSets[i]
3659 descriptorSetObject := GetDescriptorSet(descriptorSet)
3660 assert(descriptorSetObject.device == device)
3661 State.DescriptorSets[descriptorSet] = null
3662 }
3663
3664 return ?
3665}
3666
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003667cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003668 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08003669 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003670 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08003671 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003672 const VkCopyDescriptorSet* pDescriptorCopies) {
3673 deviceObject := GetDevice(device)
3674
Jesse Hallb00daad2015-11-29 19:46:20 -08003675 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
3676 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003677 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003678 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003679 assert(descriptorWriteObject.device == device)
3680 }
3681
Jesse Hallb00daad2015-11-29 19:46:20 -08003682 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
3683 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003684 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003685 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003686 assert(descriptorCopyObject.device == device)
3687 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003688}
3689
3690
3691// Framebuffer functions
3692
3693@threadSafety("system")
3694cmd VkResult vkCreateFramebuffer(
3695 VkDevice device,
3696 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003697 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003698 VkFramebuffer* pFramebuffer) {
3699 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
3700 deviceObject := GetDevice(device)
3701
3702 framebuffer := ?
3703 pFramebuffer[0] = framebuffer
3704 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
3705
3706 return ?
3707}
3708
3709@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003710cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003712 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003713 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003714 deviceObject := GetDevice(device)
3715 framebufferObject := GetFramebuffer(framebuffer)
3716 assert(framebufferObject.device == device)
3717
3718 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003719}
3720
3721
3722// Renderpass functions
3723
3724@threadSafety("system")
3725cmd VkResult vkCreateRenderPass(
3726 VkDevice device,
3727 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003728 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003729 VkRenderPass* pRenderPass) {
3730 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
3731 deviceObject := GetDevice(device)
3732
3733 renderpass := ?
3734 pRenderPass[0] = renderpass
3735 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
3736
3737 return ?
3738}
3739
3740@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003741cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003742 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003743 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003744 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003745 deviceObject := GetDevice(device)
3746 renderPassObject := GetRenderPass(renderPass)
3747 assert(renderPassObject.device == device)
3748
3749 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003750}
3751
Jesse Hall606a54e2015-11-19 22:17:28 -08003752cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003753 VkDevice device,
3754 VkRenderPass renderPass,
3755 VkExtent2D* pGranularity) {
3756 deviceObject := GetDevice(device)
3757 renderPassObject := GetRenderPass(renderPass)
3758
3759 granularity := ?
3760 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07003761}
3762
3763// Command pool functions
3764
3765cmd VkResult vkCreateCommandPool(
3766 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003767 const VkCommandPoolCreateInfo* pCreateInfo,
3768 const VkAllocationCallbacks* pAllocator,
3769 VkCommandPool* pCommandPool) {
3770 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003771 deviceObject := GetDevice(device)
3772
Jesse Hall3fbc8562015-11-29 22:10:52 -08003773 commandPool := ?
3774 pCommandPool[0] = commandPool
3775 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003776
3777 return ?
3778}
3779
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003780cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003781 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003782 VkCommandPool commandPool,
3783 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003784 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003785 commandPoolObject := GetCommandPool(commandPool)
3786 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003787
Jesse Hall3fbc8562015-11-29 22:10:52 -08003788 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003789}
3790
3791cmd VkResult vkResetCommandPool(
3792 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003793 VkCommandPool commandPool,
3794 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003795 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003796 commandPoolObject := GetCommandPool(commandPool)
3797 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003798
3799 return ?
3800}
3801
3802// Command buffer functions
3803
Jesse Hall3fbc8562015-11-29 22:10:52 -08003804macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
3805 memoryObject := GetDeviceMemory(memory)
3806 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07003807
Jesse Hall3fbc8562015-11-29 22:10:52 -08003808 commandBufferObject := GetCommandBuffer(commandBuffer)
3809 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07003810}
3811
Jesse Hall3fbc8562015-11-29 22:10:52 -08003812macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
3813 memoryObject := GetDeviceMemory(memory)
3814 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003815
Jesse Hall3fbc8562015-11-29 22:10:52 -08003816 commandBufferObject := GetCommandBuffer(commandBuffer)
3817 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003818}
3819
3820@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003821cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003822 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003823 const VkCommandBufferAllocateInfo* pAllocateInfo,
3824 VkCommandBuffer* pCommandBuffers) {
3825 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOC_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003826
Jesse Hall3fbc8562015-11-29 22:10:52 -08003827 count := pAllocateInfo[0].bufferCount
3828 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003829 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003830 commandBuffer := ?
3831 commandBuffers[i] = commandBuffer
3832 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08003833 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003834
3835 return ?
3836}
3837
3838@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08003839cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003840 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003841 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003842 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003843 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003844 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003845
Jesse Hall3fbc8562015-11-29 22:10:52 -08003846 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08003847 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003848 commandBufferObject := GetCommandBuffer(commandBuffers[i])
3849 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08003850 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08003851 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08003852 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003853}
3854
3855@threadSafety("app")
3856cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003857 VkCommandBuffer commandBuffer,
3858 const VkCommandBufferBeginInfo* pBeginInfo) {
3859 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
3860 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003861
3862 // TODO: iterate over boundObjects and clear memory bindings
3863
3864 return ?
3865}
3866
3867@threadSafety("app")
3868cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003869 VkCommandBuffer commandBuffer) {
3870 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003871
3872 return ?
3873}
3874
3875@threadSafety("app")
3876cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003877 VkCommandBuffer commandBuffer,
3878 VkCommandBufferResetFlags flags) {
3879 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003880
3881 // TODO: iterate over boundObjects and clear memory bindings
3882
3883 return ?
3884}
3885
3886
3887// Command buffer building functions
3888
3889@threadSafety("app")
3890cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003891 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003892 VkPipelineBindPoint pipelineBindPoint,
3893 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003894 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003895 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003896 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003897
Jesse Halld8bade02015-11-24 10:24:18 -08003898 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003899 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
3900 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
3901 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003902 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003903}
3904
3905@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003906cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003907 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003908 u32 viewportCount,
3909 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003910 commandBufferObject := GetCommandBuffer(commandBuffer)
3911 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003912}
3913
3914@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003915cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003916 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003917 u32 scissorCount,
3918 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003919 commandBufferObject := GetCommandBuffer(commandBuffer)
3920 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003921}
3922
3923@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003924cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003925 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003926 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003927 commandBufferObject := GetCommandBuffer(commandBuffer)
3928 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003929}
3930
3931@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003932cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003933 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003934 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003935 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003936 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003937 commandBufferObject := GetCommandBuffer(commandBuffer)
3938 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003939}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003940
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003941@threadSafety("app")
3942cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003943 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003944 // TODO(jessehall): apic only supports 'const' on pointer types. Using
3945 // an annotation as a quick hack to pass this to the template without
3946 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08003947 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003948 commandBufferObject := GetCommandBuffer(commandBuffer)
3949 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003950}
3951
3952@threadSafety("app")
3953cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003954 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003955 f32 minDepthBounds,
3956 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003957 commandBufferObject := GetCommandBuffer(commandBuffer)
3958 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003959}
3960
3961@threadSafety("app")
3962cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003963 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003964 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08003965 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003966 commandBufferObject := GetCommandBuffer(commandBuffer)
3967 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003968}
3969
3970@threadSafety("app")
3971cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003972 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003973 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08003974 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003975 commandBufferObject := GetCommandBuffer(commandBuffer)
3976 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003977}
3978
3979@threadSafety("app")
3980cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003981 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003982 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08003983 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003984 commandBufferObject := GetCommandBuffer(commandBuffer)
3985 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003986}
3987
3988@threadSafety("app")
3989cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003990 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003991 VkPipelineBindPoint pipelineBindPoint,
3992 VkPipelineLayout layout,
3993 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003994 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003995 const VkDescriptorSet* pDescriptorSets,
3996 u32 dynamicOffsetCount,
3997 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003998 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003999
Jesse Hall03b6fe12015-11-24 12:44:21 -08004000 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4001 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004002 descriptorSet := descriptorSets[i]
4003 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004004 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004005 }
4006
4007 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4008 for i in (0 .. dynamicOffsetCount) {
4009 dynamicOffset := dynamicOffsets[i]
4010 }
4011
Jesse Halld8bade02015-11-24 10:24:18 -08004012 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004013 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4014 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4015 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004016 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004017}
4018
4019@threadSafety("app")
4020cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004021 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004022 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004023 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004024 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004025 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004026 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004027 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004028
Jesse Hall3fbc8562015-11-29 22:10:52 -08004029 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004030
Jesse Hall3fbc8562015-11-29 22:10:52 -08004031 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004032}
4033
4034@threadSafety("app")
4035cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004036 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004037 u32 startBinding,
4038 u32 bindingCount,
4039 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004040 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004041 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004042
4043 // TODO: check if not [startBinding:startBinding+bindingCount]
4044 buffers := pBuffers[0:bindingCount]
4045 offsets := pOffsets[0:bindingCount]
4046 for i in (0 .. bindingCount) {
4047 buffer := buffers[i]
4048 offset := offsets[i]
4049 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004050 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004051
Jesse Hall3fbc8562015-11-29 22:10:52 -08004052 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004053 }
4054
Jesse Hall3fbc8562015-11-29 22:10:52 -08004055 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004056}
4057
4058@threadSafety("app")
4059cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004060 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004061 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004062 u32 instanceCount,
4063 u32 firstVertex,
4064 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004065 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004066
Jesse Hall3fbc8562015-11-29 22:10:52 -08004067 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004068}
4069
4070@threadSafety("app")
4071cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004072 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004073 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004074 u32 instanceCount,
4075 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004076 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004077 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004078 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004079
Jesse Hall3fbc8562015-11-29 22:10:52 -08004080 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004081}
4082
4083@threadSafety("app")
4084cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004085 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004086 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004087 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004088 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004089 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004090 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004091 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004092 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004093
Jesse Hall3fbc8562015-11-29 22:10:52 -08004094 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004095
Jesse Hall3fbc8562015-11-29 22:10:52 -08004096 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004097}
4098
4099@threadSafety("app")
4100cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004101 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004102 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004103 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004104 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004105 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004106 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004107 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004108 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004109
Jesse Hall3fbc8562015-11-29 22:10:52 -08004110 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004111
Jesse Hall3fbc8562015-11-29 22:10:52 -08004112 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004113}
4114
4115@threadSafety("app")
4116cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004117 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004118 u32 x,
4119 u32 y,
4120 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004121 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004122
Jesse Hall3fbc8562015-11-29 22:10:52 -08004123 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004124}
4125
4126@threadSafety("app")
4127cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004128 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004129 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004130 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004131 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004132 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004133 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004134
Jesse Hall3fbc8562015-11-29 22:10:52 -08004135 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004136
Jesse Hall3fbc8562015-11-29 22:10:52 -08004137 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004138}
4139
4140@threadSafety("app")
4141cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004142 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004143 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004144 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004145 u32 regionCount,
4146 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004147 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004148 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004149 dstBufferObject := GetBuffer(dstBuffer)
4150 assert(commandBufferObject.device == srcBufferObject.device)
4151 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004152
4153 regions := pRegions[0:regionCount]
4154 for i in (0 .. regionCount) {
4155 region := regions[i]
4156 }
4157
Jesse Hall3fbc8562015-11-29 22:10:52 -08004158 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4159 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004160
Jesse Hall65ab5522015-11-30 00:07:16 -08004161 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004162}
4163
4164@threadSafety("app")
4165cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004166 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004167 VkImage srcImage,
4168 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004169 VkImage dstImage,
4170 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004171 u32 regionCount,
4172 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004173 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004174 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004175 dstImageObject := GetImage(dstImage)
4176 assert(commandBufferObject.device == srcImageObject.device)
4177 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004178
4179 regions := pRegions[0:regionCount]
4180 for i in (0 .. regionCount) {
4181 region := regions[i]
4182 }
4183
Jesse Hall3fbc8562015-11-29 22:10:52 -08004184 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4185 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004186
Jesse Hall65ab5522015-11-30 00:07:16 -08004187 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004188}
4189
4190@threadSafety("app")
4191cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004192 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004193 VkImage srcImage,
4194 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004195 VkImage dstImage,
4196 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004197 u32 regionCount,
4198 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004199 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004200 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004201 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004202 dstImageObject := GetImage(dstImage)
4203 assert(commandBufferObject.device == srcImageObject.device)
4204 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004205
4206 regions := pRegions[0:regionCount]
4207 for i in (0 .. regionCount) {
4208 region := regions[i]
4209 }
4210
Jesse Hall3fbc8562015-11-29 22:10:52 -08004211 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4212 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004213
Jesse Hall3fbc8562015-11-29 22:10:52 -08004214 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004215}
4216
4217@threadSafety("app")
4218cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004219 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004220 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004221 VkImage dstImage,
4222 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004223 u32 regionCount,
4224 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004225 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004226 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004227 dstImageObject := GetImage(dstImage)
4228 assert(commandBufferObject.device == srcBufferObject.device)
4229 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004230
4231 regions := pRegions[0:regionCount]
4232 for i in (0 .. regionCount) {
4233 region := regions[i]
4234 }
4235
Jesse Hall3fbc8562015-11-29 22:10:52 -08004236 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4237 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004238
Jesse Hall65ab5522015-11-30 00:07:16 -08004239 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004240}
4241
4242@threadSafety("app")
4243cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004244 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004245 VkImage srcImage,
4246 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004247 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004248 u32 regionCount,
4249 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004250 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004251 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004252 dstBufferObject := GetBuffer(dstBuffer)
4253 assert(commandBufferObject.device == srcImageObject.device)
4254 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004255
4256 regions := pRegions[0:regionCount]
4257 for i in (0 .. regionCount) {
4258 region := regions[i]
4259 }
4260
Jesse Hall3fbc8562015-11-29 22:10:52 -08004261 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4262 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004263
Jesse Hall65ab5522015-11-30 00:07:16 -08004264 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004265}
4266
4267@threadSafety("app")
4268cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004269 VkCommandBuffer commandBuffer,
4270 VkBuffer dstBuffer,
4271 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004272 VkDeviceSize dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004273 const u32* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004274 commandBufferObject := GetCommandBuffer(commandBuffer)
4275 dstBufferObject := GetBuffer(dstBuffer)
4276 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004277
4278 data := pData[0:dataSize]
4279
Jesse Hall3fbc8562015-11-29 22:10:52 -08004280 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004281
Jesse Hall65ab5522015-11-30 00:07:16 -08004282 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004283}
4284
4285@threadSafety("app")
4286cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004287 VkCommandBuffer commandBuffer,
4288 VkBuffer dstBuffer,
4289 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004290 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004291 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004292 commandBufferObject := GetCommandBuffer(commandBuffer)
4293 dstBufferObject := GetBuffer(dstBuffer)
4294 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004295
Jesse Hall65ab5522015-11-30 00:07:16 -08004296 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004297}
4298
4299@threadSafety("app")
4300cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004301 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004302 VkImage image,
4303 VkImageLayout imageLayout,
4304 const VkClearColorValue* pColor,
4305 u32 rangeCount,
4306 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004307 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004308 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004309 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004310
4311 ranges := pRanges[0:rangeCount]
4312 for i in (0 .. rangeCount) {
4313 range := ranges[i]
4314 }
4315
Jesse Hall3fbc8562015-11-29 22:10:52 -08004316 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004317
Jesse Hall3fbc8562015-11-29 22:10:52 -08004318 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004319}
4320
4321@threadSafety("app")
4322cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004323 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004324 VkImage image,
4325 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004326 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004327 u32 rangeCount,
4328 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004329 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004330 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004331 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004332
4333 ranges := pRanges[0:rangeCount]
4334 for i in (0 .. rangeCount) {
4335 range := ranges[i]
4336 }
4337
Jesse Hall3fbc8562015-11-29 22:10:52 -08004338 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004339
Jesse Hall3fbc8562015-11-29 22:10:52 -08004340 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004341}
4342
4343@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08004344cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004345 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08004346 u32 attachmentCount,
4347 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004348 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08004349 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004350 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004351
4352 rects := pRects[0:rectCount]
4353 for i in (0 .. rectCount) {
4354 rect := rects[i]
4355 }
4356
Jesse Hall3fbc8562015-11-29 22:10:52 -08004357 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004358}
4359
4360@threadSafety("app")
4361cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004362 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004363 VkImage srcImage,
4364 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004365 VkImage dstImage,
4366 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004367 u32 regionCount,
4368 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004369 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004370 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004371 dstImageObject := GetImage(dstImage)
4372 assert(commandBufferObject.device == srcImageObject.device)
4373 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004374
4375 regions := pRegions[0:regionCount]
4376 for i in (0 .. regionCount) {
4377 region := regions[i]
4378 }
4379
Jesse Hall3fbc8562015-11-29 22:10:52 -08004380 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4381 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004382
Jesse Hall3fbc8562015-11-29 22:10:52 -08004383 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004384}
4385
4386@threadSafety("app")
4387cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004388 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004389 VkEvent event,
4390 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004391 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004392 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004393 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004394}
4395
4396@threadSafety("app")
4397cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004398 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004399 VkEvent event,
4400 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004401 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004402 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004403 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004404}
4405
4406@threadSafety("app")
4407cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004408 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004409 u32 eventCount,
4410 const VkEvent* pEvents,
4411 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004412 VkPipelineStageFlags dstStageMask,
4413 u32 memoryBarrierCount,
4414 const void* const* ppMemoryBarriers) {
4415 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004416
4417 events := pEvents[0:eventCount]
4418 for i in (0 .. eventCount) {
4419 event := events[i]
4420 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004421 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004422 }
4423
Jesse Hall3fbc8562015-11-29 22:10:52 -08004424 pMemoryBarriers := ppMemoryBarriers[0:memoryBarrierCount]
4425 for i in (0 .. memoryBarrierCount) {
4426 switch as!VkMemoryBarrier const*(pMemoryBarriers[i])[0].sType {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004427 case VK_STRUCTURE_TYPE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004428 memoryBarrier := as!VkMemoryBarrier const*(pMemoryBarriers[i])[0]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004429 }
4430 case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004431 imageMemoryBarrier := as!VkImageMemoryBarrier const*(pMemoryBarriers[i])[0]
4432 imageObject := GetImage(imageMemoryBarrier.image)
4433 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004434 }
4435 case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004436 bufferMemoryBarrier := as!VkBufferMemoryBarrier const*(pMemoryBarriers[i])[0]
4437 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4438 assert(bufferObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004439 }
4440 }
4441 }
4442}
4443
4444@threadSafety("app")
4445cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004446 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004447 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004448 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08004449 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004450 u32 memoryBarrierCount,
4451 const void* const* ppMemoryBarriers) {
4452 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004453
Jesse Hall3fbc8562015-11-29 22:10:52 -08004454 pMemoryBarriers := ppMemoryBarriers[0:memoryBarrierCount]
4455 for i in (0 .. memoryBarrierCount) {
4456 switch as!VkMemoryBarrier const*(pMemoryBarriers[i])[0].sType {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004457 case VK_STRUCTURE_TYPE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004458 memoryBarrier := as!VkMemoryBarrier const*(pMemoryBarriers[i])[0]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004459 }
4460 case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004461 imageMemoryBarrier := as!VkImageMemoryBarrier const*(pMemoryBarriers[i])[0]
4462 imageObject := GetImage(imageMemoryBarrier.image)
4463 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004464 }
4465 case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004466 bufferMemoryBarrier := as!VkBufferMemoryBarrier const*(pMemoryBarriers[i])[0]
4467 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4468 assert(bufferObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004469 }
4470 }
4471 }
4472}
4473
4474@threadSafety("app")
4475cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004476 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004477 VkQueryPool queryPool,
Jesse Hall65ab5522015-11-30 00:07:16 -08004478 u32 entry,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004479 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004480 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004481 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004482 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004483}
4484
4485@threadSafety("app")
4486cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004487 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488 VkQueryPool queryPool,
Jesse Hall65ab5522015-11-30 00:07:16 -08004489 u32 entry) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004490 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004491 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004492 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004493}
4494
4495@threadSafety("app")
4496cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004497 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004498 VkQueryPool queryPool,
4499 u32 startQuery,
4500 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004501 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004502 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004503 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004504}
4505
4506@threadSafety("app")
4507cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004508 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08004509 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004510 VkQueryPool queryPool,
Jesse Hall65ab5522015-11-30 00:07:16 -08004511 u32 entry) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004512 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004513 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004514 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004515}
4516
4517@threadSafety("app")
4518cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004519 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004520 VkQueryPool queryPool,
4521 u32 startQuery,
4522 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004523 VkBuffer dstBuffer,
4524 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004525 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004526 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004527 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004528 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004529 dstBufferObject := GetBuffer(dstBuffer)
4530 assert(commandBufferObject.device == queryPoolObject.device)
4531 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004532}
4533
4534cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004535 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004536 VkPipelineLayout layout,
4537 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004538 u32 offset,
4539 u32 size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004540 const void* values) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004541 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004542 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004543 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004544}
4545
4546@threadSafety("app")
4547cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004548 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004549 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08004550 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004551 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004552 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
4553 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004554 assert(commandBufferObject.device == renderPassObject.device)
4555 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004556
Jesse Hall3fbc8562015-11-29 22:10:52 -08004557 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004558}
4559
4560cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004561 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08004562 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004563 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004564}
4565
4566@threadSafety("app")
4567cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004568 VkCommandBuffer commandBuffer) {
4569 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004570
Jesse Hall3fbc8562015-11-29 22:10:52 -08004571 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004572}
4573
4574cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004575 VkCommandBuffer commandBuffer,
4576 u32 commandBuffersCount,
4577 const VkCommandBuffer* pCommandBuffers) {
4578 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004579
Jesse Hall3fbc8562015-11-29 22:10:52 -08004580 commandBuffers := pCommandBuffers[0:commandBuffersCount]
4581 for i in (0 .. commandBuffersCount) {
4582 secondaryCommandBuffer := commandBuffers[i]
4583 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
4584 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004585 }
4586}
4587
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004588@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004589cmd void vkDestroySurfaceKHR(
4590 VkInstance instance,
4591 VkSurfaceKHR surface) {
4592 instanceObject := GetInstance(instance)
4593 surfaceObject := GetSurface(surface)
4594 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08004595
Jesse Hall1356b0d2015-11-23 17:24:58 -08004596 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08004597}
4598
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004599@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004600cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004601 VkPhysicalDevice physicalDevice,
4602 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004603 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08004604 VkBool32* pSupported) {
4605 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004606
4607 return ?
4608}
4609
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004610@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004611cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
4612 VkPhysicalDevice physicalDevice,
4613 VkSurfaceKHR surface,
4614 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
4615 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4616
4617 surfaceCapabilities := ?
4618 pSurfaceCapabilities[0] = surfaceCapabilities
4619
4620 return ?
4621}
4622
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004623@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004624cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
4625 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004626 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004627 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004628 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004629 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004630
4631 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004632 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004633 surfaceFormats := pSurfaceFormats[0:count]
4634
4635 for i in (0 .. count) {
4636 surfaceFormat := ?
4637 surfaceFormats[i] = surfaceFormat
4638 }
4639
4640 return ?
4641}
4642
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004643@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004644cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
4645 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004646 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004647 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004648 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004649 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004650
4651 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004652 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004653 presentModes := pPresentModes[0:count]
4654
4655 for i in (0 .. count) {
4656 presentMode := ?
4657 presentModes[i] = presentMode
4658 }
4659
4660 return ?
4661}
4662
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004663@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004664cmd VkResult vkCreateSwapchainKHR(
4665 VkDevice device,
4666 const VkSwapchainCreateInfoKHR* pCreateInfo,
4667 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004668 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08004669 deviceObject := GetDevice(device)
4670
4671 swapchain := ?
4672 pSwapchain[0] = swapchain
4673 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
4674
4675 return ?
4676}
4677
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004678@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004679cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08004680 VkDevice device,
4681 VkSwapchainKHR swapchain) {
4682 deviceObject := GetDevice(device)
4683 swapchainObject := GetSwapchain(swapchain)
4684 assert(swapchainObject.device == device)
4685
4686 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08004687}
4688
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004689@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004690cmd VkResult vkGetSwapchainImagesKHR(
4691 VkDevice device,
4692 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004693 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08004694 VkImage* pSwapchainImages) {
4695 deviceObject := GetDevice(device)
4696
4697 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004698 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004699 swapchainImages := pSwapchainImages[0:count]
4700
4701 for i in (0 .. count) {
4702 swapchainImage := ?
4703 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08004704 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08004705 }
4706
4707 return ?
4708}
4709
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004710@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004711cmd VkResult vkAcquireNextImageKHR(
4712 VkDevice device,
4713 VkSwapchainKHR swapchain,
4714 u64 timeout,
4715 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004716 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08004717 u32* pImageIndex) {
4718 deviceObject := GetDevice(device)
4719 swapchainObject := GetSwapchain(swapchain)
4720
4721 imageIndex := ?
4722 pImageIndex[0] = imageIndex
4723
4724 return ?
4725}
4726
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004727@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004728cmd VkResult vkQueuePresentKHR(
4729 VkQueue queue,
4730 VkPresentInfoKHR* pPresentInfo) {
4731 queueObject := GetQueue(queue)
4732
4733 presentInfo := ?
4734 pPresentInfo[0] = presentInfo
4735
4736 return ?
4737}
4738
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004739@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004740cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
4741 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004742 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004743 VkDisplayPropertiesKHR* pProperties) {
4744 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4745 return ?
4746}
4747
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004748@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004749cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
4750 VkPhysicalDevice physicalDevice,
4751 u32* pPropertyCount,
4752 VkDisplayPlanePropertiesKHR* pProperties) {
4753 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4754 return ?
4755}
4756
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004757@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004758cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
4759 VkPhysicalDevice physicalDevice,
4760 u32* pPropertyCount,
4761 VkDisplayKHR* pProperties) {
4762 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4763 return ?
4764}
4765
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004766@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004767cmd VkResult vkGetDisplayModePropertiesKHR(
4768 VkPhysicalDevice physicalDevice,
4769 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004770 u32* pPropertyCount,
4771 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004772 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4773 return ?
4774}
4775
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004776@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004777cmd VkResult vkCreateDisplayModeKHR(
4778 VkPhysicalDevice physicalDevice,
4779 VkDisplayKHR display,
4780 const VkDisplayModeCreateInfoKHR* pCreateInfo,
4781 VkDisplayModeKHR* pMode) {
4782 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4783 return ?
4784}
4785
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004786@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004787cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004788 VkPhysicalDevice physicalDevice,
Jesse Halla6429252015-11-29 18:59:42 -08004789 VkDisplayModeCreateInfoKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004790 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08004791 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004792 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4793 return ?
4794}
4795
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004796@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004797cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
4798 VkInstance instance,
4799 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
4800 VkSurfaceKHR* pSurface) {
4801 return ?
4802}
4803
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004804@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004805cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004806 VkInstance instance,
4807 platform.Display* dpy,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004808 platform.Window window,
4809 VkSurfaceKHR* pSurface) {
4810 instanceObject := GetInstance(instance)
4811 return ?
4812}
4813
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004814@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004815cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
4816 VkPhysicalDevice physicalDevice,
4817 u32 queueFamilyIndex,
4818 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08004819 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08004820 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4821 return ?
4822}
4823
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004824@extension("VK_KHR_xcb_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004825cmd VkResult vkCreateXCBSurfaceKHR(
4826 VkInstance instance,
4827 platform.xcb_connection_t* connection,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004828 platform.xcb_window_t window,
4829 VkSurfaceKHR* pSurface) {
4830 instanceObject := GetInstance(instance)
4831 return ?
4832}
4833
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004834@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004835cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
4836 VkPhysicalDevice physicalDevice,
4837 u32 queueFamilyIndex,
4838 platform.xcb_connection_t* connection,
4839 platform.xcb_visualid_t visual_id) {
4840 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4841 return ?
4842}
4843
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004844@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004845cmd VkResult vkCreateWaylandSurfaceKHR(
4846 VkInstance instance,
4847 platform.wl_display* display,
4848 platform.wl_surface* surface,
4849 VkSurfaceKHR* pSurface) {
4850 instanceObject := GetInstance(instance)
4851 return ?
4852}
4853
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004854@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004855cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
4856 VkPhysicalDevice physicalDevice,
4857 u32 queueFamilyIndex,
4858 platform.wl_display* display) {
4859 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4860 return ?
4861}
4862
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004863@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004864cmd VkResult vkCreateMirSurfaceKHR(
4865 VkInstance instance,
4866 platform.MirConnection* connection,
4867 platform.MirSurface* mirSurface,
4868 VkSurfaceKHR* pSurface) {
4869 instanceObject := GetInstance(instance)
4870 return ?
4871}
4872
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004873@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004874cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
4875 VkPhysicalDevice physicalDevice,
4876 u32 queueFamilyIndex,
4877 platform.MirConnection* connection) {
4878 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4879 return ?
4880}
4881
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004882@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004883cmd VkResult vkCreateAndroidSurfaceKHR(
4884 VkInstance instance,
4885 platform.ANativeWindow* window
4886 VkSurfaceKHR* pSurface) {
4887 instanceObject := GetInstance(instance)
4888 return ?
4889}
4890
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004891@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004892cmd VkResult vkCreateWin32SurfaceKHR(
4893 VkInstance instance,
4894 platform.HINSTANCE hinstance,
4895 platform.HWND hwnd,
4896 VkSurfaceKHR* pSurface) {
4897 instanceObject := GetInstance(instance)
4898 return ?
4899}
4900
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004901@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004902cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
4903 VkPhysicalDevice physicalDevice,
4904 u32 queueFamilyIndex) {
4905 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4906 return ?
4907}
4908
Jesse Halld27f6aa2015-08-15 17:58:48 -07004909
4910////////////////
4911// Validation //
4912////////////////
4913
4914extern void validate(string layerName, bool condition, string message)
4915
4916
4917/////////////////////////////
4918// Internal State Tracking //
4919/////////////////////////////
4920
4921StateObject State
4922
4923@internal class StateObject {
4924 // Dispatchable objects.
4925 map!(VkInstance, ref!InstanceObject) Instances
4926 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
4927 map!(VkDevice, ref!DeviceObject) Devices
4928 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08004929 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07004930
4931 // Non-dispatchable objects.
4932 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
4933 map!(VkBuffer, ref!BufferObject) Buffers
4934 map!(VkBufferView, ref!BufferViewObject) BufferViews
4935 map!(VkImage, ref!ImageObject) Images
4936 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07004937 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07004938 map!(VkPipeline, ref!PipelineObject) Pipelines
4939 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
4940 map!(VkSampler, ref!SamplerObject) Samplers
4941 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
4942 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
4943 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07004944 map!(VkFence, ref!FenceObject) Fences
4945 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
4946 map!(VkEvent, ref!EventObject) Events
4947 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
4948 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
4949 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
4950 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08004951 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08004952 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08004953 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07004954}
4955
4956@internal class InstanceObject {
4957}
4958
4959@internal class PhysicalDeviceObject {
4960 VkInstance instance
4961}
4962
4963@internal class DeviceObject {
4964 VkPhysicalDevice physicalDevice
4965}
4966
4967@internal class QueueObject {
4968 VkDevice device
4969 VkQueueFlags flags
4970}
4971
Jesse Hall3fbc8562015-11-29 22:10:52 -08004972@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004973 VkDevice device
4974 map!(u64, VkDeviceMemory) boundObjects
4975 VkQueueFlags queueFlags
4976}
4977
4978@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004979 VkDevice device
4980 VkDeviceSize allocationSize
4981 map!(u64, VkDeviceSize) boundObjects
4982 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07004983}
4984
4985@internal class BufferObject {
4986 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08004987 VkDeviceMemory memory
4988 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07004989}
4990
4991@internal class BufferViewObject {
4992 VkDevice device
4993 VkBuffer buffer
4994}
4995
4996@internal class ImageObject {
4997 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08004998 VkDeviceMemory memory
4999 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005000}
5001
5002@internal class ImageViewObject {
5003 VkDevice device
5004 VkImage image
5005}
5006
Jesse Halld27f6aa2015-08-15 17:58:48 -07005007@internal class ShaderObject {
5008 VkDevice device
5009}
5010
5011@internal class ShaderModuleObject {
5012 VkDevice device
5013}
5014
5015@internal class PipelineObject {
5016 VkDevice device
5017}
5018
5019@internal class PipelineLayoutObject {
5020 VkDevice device
5021}
5022
5023@internal class SamplerObject {
5024 VkDevice device
5025}
5026
5027@internal class DescriptorSetObject {
5028 VkDevice device
5029}
5030
5031@internal class DescriptorSetLayoutObject {
5032 VkDevice device
5033}
5034
5035@internal class DescriptorPoolObject {
5036 VkDevice device
5037}
5038
Jesse Halld27f6aa2015-08-15 17:58:48 -07005039@internal class FenceObject {
5040 VkDevice device
5041 bool signaled
5042}
5043
5044@internal class SemaphoreObject {
5045 VkDevice device
5046}
5047
5048@internal class EventObject {
5049 VkDevice device
5050}
5051
5052@internal class QueryPoolObject {
5053 VkDevice device
5054}
5055
5056@internal class FramebufferObject {
5057 VkDevice device
5058}
5059
5060@internal class RenderPassObject {
5061 VkDevice device
5062}
5063
5064@internal class PipelineCacheObject {
5065 VkDevice device
5066}
5067
Jesse Hall3fbc8562015-11-29 22:10:52 -08005068@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005069 VkDevice device
5070}
5071
Jesse Hall1356b0d2015-11-23 17:24:58 -08005072@internal class SurfaceObject {
5073 VkInstance instance
5074}
5075
Michael Lentine88594d72015-11-12 12:49:45 -08005076@internal class SwapchainObject {
5077 VkDevice device
5078}
5079
Jesse Halld27f6aa2015-08-15 17:58:48 -07005080macro ref!InstanceObject GetInstance(VkInstance instance) {
5081 assert(instance in State.Instances)
5082 return State.Instances[instance]
5083}
5084
5085macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
5086 assert(physicalDevice in State.PhysicalDevices)
5087 return State.PhysicalDevices[physicalDevice]
5088}
5089
5090macro ref!DeviceObject GetDevice(VkDevice device) {
5091 assert(device in State.Devices)
5092 return State.Devices[device]
5093}
5094
5095macro ref!QueueObject GetQueue(VkQueue queue) {
5096 assert(queue in State.Queues)
5097 return State.Queues[queue]
5098}
5099
Jesse Hall3fbc8562015-11-29 22:10:52 -08005100macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
5101 assert(commandBuffer in State.CommandBuffers)
5102 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005103}
5104
Jesse Hall3fbc8562015-11-29 22:10:52 -08005105macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
5106 assert(memory in State.DeviceMemories)
5107 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005108}
5109
5110macro ref!BufferObject GetBuffer(VkBuffer buffer) {
5111 assert(buffer in State.Buffers)
5112 return State.Buffers[buffer]
5113}
5114
5115macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
5116 assert(bufferView in State.BufferViews)
5117 return State.BufferViews[bufferView]
5118}
5119
5120macro ref!ImageObject GetImage(VkImage image) {
5121 assert(image in State.Images)
5122 return State.Images[image]
5123}
5124
5125macro ref!ImageViewObject GetImageView(VkImageView imageView) {
5126 assert(imageView in State.ImageViews)
5127 return State.ImageViews[imageView]
5128}
5129
Jesse Halld27f6aa2015-08-15 17:58:48 -07005130macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
5131 assert(shaderModule in State.ShaderModules)
5132 return State.ShaderModules[shaderModule]
5133}
5134
5135macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
5136 assert(pipeline in State.Pipelines)
5137 return State.Pipelines[pipeline]
5138}
5139
5140macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
5141 assert(pipelineLayout in State.PipelineLayouts)
5142 return State.PipelineLayouts[pipelineLayout]
5143}
5144
5145macro ref!SamplerObject GetSampler(VkSampler sampler) {
5146 assert(sampler in State.Samplers)
5147 return State.Samplers[sampler]
5148}
5149
5150macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
5151 assert(descriptorSet in State.DescriptorSets)
5152 return State.DescriptorSets[descriptorSet]
5153}
5154
5155macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
5156 assert(descriptorSetLayout in State.DescriptorSetLayouts)
5157 return State.DescriptorSetLayouts[descriptorSetLayout]
5158}
5159
5160macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
5161 assert(descriptorPool in State.DescriptorPools)
5162 return State.DescriptorPools[descriptorPool]
5163}
5164
Jesse Halld27f6aa2015-08-15 17:58:48 -07005165macro ref!FenceObject GetFence(VkFence fence) {
5166 assert(fence in State.Fences)
5167 return State.Fences[fence]
5168}
5169
5170macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
5171 assert(semaphore in State.Semaphores)
5172 return State.Semaphores[semaphore]
5173}
5174
5175macro ref!EventObject GetEvent(VkEvent event) {
5176 assert(event in State.Events)
5177 return State.Events[event]
5178}
5179
5180macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
5181 assert(queryPool in State.QueryPools)
5182 return State.QueryPools[queryPool]
5183}
5184
5185macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
5186 assert(framebuffer in State.Framebuffers)
5187 return State.Framebuffers[framebuffer]
5188}
5189
5190macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
5191 assert(renderPass in State.RenderPasses)
5192 return State.RenderPasses[renderPass]
5193}
5194
5195macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
5196 assert(pipelineCache in State.PipelineCaches)
5197 return State.PipelineCaches[pipelineCache]
5198}
5199
Jesse Hall3fbc8562015-11-29 22:10:52 -08005200macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
5201 assert(commandPool in State.CommandPools)
5202 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07005203}
Michael Lentine88594d72015-11-12 12:49:45 -08005204
Jesse Hall1356b0d2015-11-23 17:24:58 -08005205macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
5206 assert(surface in State.Surfaces)
5207 return State.Surfaces[surface]
5208}
5209
Michael Lentine88594d72015-11-12 12:49:45 -08005210macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
5211 assert(swapchain in State.Swapchains)
5212 return State.Swapchains[swapchain]
5213}
Jesse Halld8bade02015-11-24 10:24:18 -08005214
5215macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
5216 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
5217}