blob: 4954d27c7533f64e3756664b6f567dcc2112e5a7 [file] [log] [blame]
Jesse Halld27f6aa2015-08-15 17:58:48 -07001// Copyright (c) 2015 The Khronos Group Inc.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a
4// copy of this software and/or associated documentation files (the
5// "Materials"), to deal in the Materials without restriction, including
6// without limitation the rights to use, copy, modify, merge, publish,
7// distribute, sublicense, and/or sell copies of the Materials, and to
8// permit persons to whom the Materials are furnished to do so, subject to
9// the following conditions:
10//
11// The above copyright notice and this permission notice shall be included
12// in all copies or substantial portions of the Materials.
13//
14// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
21
22import platform "platform.api"
23
24///////////////
25// Constants //
26///////////////
27
28// API version (major.minor.patch)
Jesse Hall3dd678a2016-01-08 21:52:01 -080029define VERSION_MAJOR 1
30define VERSION_MINOR 0
Chris Forbes289cb792016-12-30 15:03:55 +130031define VERSION_PATCH 38
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall33faaad2016-01-24 21:00:49 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall26763382016-05-20 07:13:52 -070051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall33faaad2016-01-24 21:00:49 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Chris Forbes8e4438b2016-12-07 16:26:49 +130078@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
Chia-I Wub262ddc2016-03-22 07:38:20 +080079@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
80
Chris Forbes289cb792016-12-30 15:03:55 +130081@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4
Jesse Hall715b86a2016-01-16 16:34:29 -080082@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
83
Jesse Hall26763382016-05-20 07:13:52 -070084@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
85@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
86
87@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
88@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
89
90@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
91@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
92
93@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
94@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
95
Jesse Hall56d386a2016-07-26 15:20:40 -070096@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
97@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
98
99@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
100@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
101
Jesse Hall26763382016-05-20 07:13:52 -0700102@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
103@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
104
Jesse Hall56d386a2016-07-26 15:20:40 -0700105@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
106@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
107
108@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
109@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
110
Chris Forbes289cb792016-12-30 15:03:55 +1300111@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
112@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
113
114@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
115@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
116
117@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
118@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
119
120@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
121@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
122
123@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
124@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
125
126@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
127@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
128
129@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
130@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
131
132@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
133@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
134
135@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
136@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
137
138@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
139@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
140
141@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
142@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
143
144
Jesse Halld27f6aa2015-08-15 17:58:48 -0700145
146/////////////
147// Types //
148/////////////
149
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700150type u32 VkBool32
151type u32 VkFlags
152type u64 VkDeviceSize
153type u32 VkSampleMask
154
Jesse Halld27f6aa2015-08-15 17:58:48 -0700155/// Dispatchable handle types.
156@dispatchHandle type u64 VkInstance
157@dispatchHandle type u64 VkPhysicalDevice
158@dispatchHandle type u64 VkDevice
159@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800160@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700161
162/// Non dispatchable handle types.
163@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800164@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700165@nonDispatchHandle type u64 VkBuffer
166@nonDispatchHandle type u64 VkBufferView
167@nonDispatchHandle type u64 VkImage
168@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700169@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700170@nonDispatchHandle type u64 VkPipeline
171@nonDispatchHandle type u64 VkPipelineLayout
172@nonDispatchHandle type u64 VkSampler
173@nonDispatchHandle type u64 VkDescriptorSet
174@nonDispatchHandle type u64 VkDescriptorSetLayout
175@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700176@nonDispatchHandle type u64 VkFence
177@nonDispatchHandle type u64 VkSemaphore
178@nonDispatchHandle type u64 VkEvent
179@nonDispatchHandle type u64 VkQueryPool
180@nonDispatchHandle type u64 VkFramebuffer
181@nonDispatchHandle type u64 VkRenderPass
182@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800183
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800184@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800185
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800186@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800187
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800188@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
189@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700190
Jesse Hall715b86a2016-01-16 16:34:29 -0800191@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
192
Chris Forbes289cb792016-12-30 15:03:55 +1300193@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
194@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
195
Jesse Halld27f6aa2015-08-15 17:58:48 -0700196
197/////////////
198// Enums //
199/////////////
200
201enum VkImageLayout {
202 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
203 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
204 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
205 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
206 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
207 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 -0800208 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
209 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 -0700210 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800211
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800212 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800213 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700214}
215
216enum VkAttachmentLoadOp {
217 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
218 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
219 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
220}
221
222enum VkAttachmentStoreOp {
223 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
224 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
225}
226
227enum VkImageType {
228 VK_IMAGE_TYPE_1D = 0x00000000,
229 VK_IMAGE_TYPE_2D = 0x00000001,
230 VK_IMAGE_TYPE_3D = 0x00000002,
231}
232
233enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800234 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
235 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700236}
237
238enum VkImageViewType {
239 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
240 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
241 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
242 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
243 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
244 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
245 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
246}
247
Jesse Hall3fbc8562015-11-29 22:10:52 -0800248enum VkCommandBufferLevel {
249 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
250 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700251}
252
Jesse Hall65ab5522015-11-30 00:07:16 -0800253enum VkComponentSwizzle {
254 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
255 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
256 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
257 VK_COMPONENT_SWIZZLE_R = 0x00000003,
258 VK_COMPONENT_SWIZZLE_G = 0x00000004,
259 VK_COMPONENT_SWIZZLE_B = 0x00000005,
260 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700261}
262
263enum VkDescriptorType {
264 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
265 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
266 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
267 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
268 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
269 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
270 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
271 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
272 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
273 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
274 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
275}
276
Jesse Halld27f6aa2015-08-15 17:58:48 -0700277enum VkQueryType {
278 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
279 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800280 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700281}
282
Jesse Halld27f6aa2015-08-15 17:58:48 -0700283enum VkBorderColor {
284 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
285 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
286 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
287 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
288 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
289 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
290}
291
292enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800293 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
294 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700295}
296
297enum VkPrimitiveTopology {
298 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
299 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
300 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
301 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
302 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
303 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800304 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
305 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
306 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
307 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800308 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700309}
310
311enum VkSharingMode {
312 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
313 VK_SHARING_MODE_CONCURRENT = 0x00000001,
314}
315
316enum VkIndexType {
317 VK_INDEX_TYPE_UINT16 = 0x00000000,
318 VK_INDEX_TYPE_UINT32 = 0x00000001,
319}
320
Jesse Hall23ff73f2015-11-29 14:36:39 -0800321enum VkFilter {
322 VK_FILTER_NEAREST = 0x00000000,
323 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700324
325 //@extension("VK_IMG_filter_cubic")
326 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700327}
328
Jesse Hall23ff73f2015-11-29 14:36:39 -0800329enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800330 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
331 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700332}
333
Jesse Hall23ff73f2015-11-29 14:36:39 -0800334enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800335 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
336 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
337 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
338 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
339 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700340}
341
342enum VkCompareOp {
343 VK_COMPARE_OP_NEVER = 0x00000000,
344 VK_COMPARE_OP_LESS = 0x00000001,
345 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800346 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700347 VK_COMPARE_OP_GREATER = 0x00000004,
348 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800349 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700350 VK_COMPARE_OP_ALWAYS = 0x00000007,
351}
352
Jesse Hall65ab5522015-11-30 00:07:16 -0800353enum VkPolygonMode {
354 VK_POLYGON_MODE_FILL = 0x00000000,
355 VK_POLYGON_MODE_LINE = 0x00000001,
356 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700357}
358
359enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800360 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
361 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700362}
363
Jesse Hall65ab5522015-11-30 00:07:16 -0800364enum VkBlendFactor {
365 VK_BLEND_FACTOR_ZERO = 0x00000000,
366 VK_BLEND_FACTOR_ONE = 0x00000001,
367 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
368 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
369 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
370 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
371 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
372 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
373 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
374 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
375 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
376 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
377 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
378 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
379 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
380 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
381 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
382 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
383 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700384}
385
386enum VkBlendOp {
387 VK_BLEND_OP_ADD = 0x00000000,
388 VK_BLEND_OP_SUBTRACT = 0x00000001,
389 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
390 VK_BLEND_OP_MIN = 0x00000003,
391 VK_BLEND_OP_MAX = 0x00000004,
392}
393
394enum VkStencilOp {
395 VK_STENCIL_OP_KEEP = 0x00000000,
396 VK_STENCIL_OP_ZERO = 0x00000001,
397 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800398 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
399 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700400 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800401 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
402 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700403}
404
405enum VkLogicOp {
406 VK_LOGIC_OP_CLEAR = 0x00000000,
407 VK_LOGIC_OP_AND = 0x00000001,
408 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
409 VK_LOGIC_OP_COPY = 0x00000003,
410 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800411 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700412 VK_LOGIC_OP_XOR = 0x00000006,
413 VK_LOGIC_OP_OR = 0x00000007,
414 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800415 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700416 VK_LOGIC_OP_INVERT = 0x0000000a,
417 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
418 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
419 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
420 VK_LOGIC_OP_NAND = 0x0000000e,
421 VK_LOGIC_OP_SET = 0x0000000f,
422}
423
Jesse Hall3fbc8562015-11-29 22:10:52 -0800424enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800425 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800426 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
427 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
428 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
429 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800430}
431
Jesse Hall3fbc8562015-11-29 22:10:52 -0800432enum VkInternalAllocationType {
433 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700434}
435
436enum VkPhysicalDeviceType {
437 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
438 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
439 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
440 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
441 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
442}
443
Jesse Hall65ab5522015-11-30 00:07:16 -0800444enum VkVertexInputRate {
445 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
446 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700447}
448
449/// Vulkan format definitions
450enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800451 VK_FORMAT_UNDEFINED = 0,
452 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
453 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
454 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
455 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
456 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
457 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
458 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
459 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
460 VK_FORMAT_R8_UNORM = 9,
461 VK_FORMAT_R8_SNORM = 10,
462 VK_FORMAT_R8_USCALED = 11,
463 VK_FORMAT_R8_SSCALED = 12,
464 VK_FORMAT_R8_UINT = 13,
465 VK_FORMAT_R8_SINT = 14,
466 VK_FORMAT_R8_SRGB = 15,
467 VK_FORMAT_R8G8_UNORM = 16,
468 VK_FORMAT_R8G8_SNORM = 17,
469 VK_FORMAT_R8G8_USCALED = 18,
470 VK_FORMAT_R8G8_SSCALED = 19,
471 VK_FORMAT_R8G8_UINT = 20,
472 VK_FORMAT_R8G8_SINT = 21,
473 VK_FORMAT_R8G8_SRGB = 22,
474 VK_FORMAT_R8G8B8_UNORM = 23,
475 VK_FORMAT_R8G8B8_SNORM = 24,
476 VK_FORMAT_R8G8B8_USCALED = 25,
477 VK_FORMAT_R8G8B8_SSCALED = 26,
478 VK_FORMAT_R8G8B8_UINT = 27,
479 VK_FORMAT_R8G8B8_SINT = 28,
480 VK_FORMAT_R8G8B8_SRGB = 29,
481 VK_FORMAT_B8G8R8_UNORM = 30,
482 VK_FORMAT_B8G8R8_SNORM = 31,
483 VK_FORMAT_B8G8R8_USCALED = 32,
484 VK_FORMAT_B8G8R8_SSCALED = 33,
485 VK_FORMAT_B8G8R8_UINT = 34,
486 VK_FORMAT_B8G8R8_SINT = 35,
487 VK_FORMAT_B8G8R8_SRGB = 36,
488 VK_FORMAT_R8G8B8A8_UNORM = 37,
489 VK_FORMAT_R8G8B8A8_SNORM = 38,
490 VK_FORMAT_R8G8B8A8_USCALED = 39,
491 VK_FORMAT_R8G8B8A8_SSCALED = 40,
492 VK_FORMAT_R8G8B8A8_UINT = 41,
493 VK_FORMAT_R8G8B8A8_SINT = 42,
494 VK_FORMAT_R8G8B8A8_SRGB = 43,
495 VK_FORMAT_B8G8R8A8_UNORM = 44,
496 VK_FORMAT_B8G8R8A8_SNORM = 45,
497 VK_FORMAT_B8G8R8A8_USCALED = 46,
498 VK_FORMAT_B8G8R8A8_SSCALED = 47,
499 VK_FORMAT_B8G8R8A8_UINT = 48,
500 VK_FORMAT_B8G8R8A8_SINT = 49,
501 VK_FORMAT_B8G8R8A8_SRGB = 50,
502 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
503 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
504 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
505 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
506 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
507 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
508 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
509 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
510 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
511 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
512 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
513 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
514 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
515 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
516 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
517 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
518 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
519 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
520 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
521 VK_FORMAT_R16_UNORM = 70,
522 VK_FORMAT_R16_SNORM = 71,
523 VK_FORMAT_R16_USCALED = 72,
524 VK_FORMAT_R16_SSCALED = 73,
525 VK_FORMAT_R16_UINT = 74,
526 VK_FORMAT_R16_SINT = 75,
527 VK_FORMAT_R16_SFLOAT = 76,
528 VK_FORMAT_R16G16_UNORM = 77,
529 VK_FORMAT_R16G16_SNORM = 78,
530 VK_FORMAT_R16G16_USCALED = 79,
531 VK_FORMAT_R16G16_SSCALED = 80,
532 VK_FORMAT_R16G16_UINT = 81,
533 VK_FORMAT_R16G16_SINT = 82,
534 VK_FORMAT_R16G16_SFLOAT = 83,
535 VK_FORMAT_R16G16B16_UNORM = 84,
536 VK_FORMAT_R16G16B16_SNORM = 85,
537 VK_FORMAT_R16G16B16_USCALED = 86,
538 VK_FORMAT_R16G16B16_SSCALED = 87,
539 VK_FORMAT_R16G16B16_UINT = 88,
540 VK_FORMAT_R16G16B16_SINT = 89,
541 VK_FORMAT_R16G16B16_SFLOAT = 90,
542 VK_FORMAT_R16G16B16A16_UNORM = 91,
543 VK_FORMAT_R16G16B16A16_SNORM = 92,
544 VK_FORMAT_R16G16B16A16_USCALED = 93,
545 VK_FORMAT_R16G16B16A16_SSCALED = 94,
546 VK_FORMAT_R16G16B16A16_UINT = 95,
547 VK_FORMAT_R16G16B16A16_SINT = 96,
548 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
549 VK_FORMAT_R32_UINT = 98,
550 VK_FORMAT_R32_SINT = 99,
551 VK_FORMAT_R32_SFLOAT = 100,
552 VK_FORMAT_R32G32_UINT = 101,
553 VK_FORMAT_R32G32_SINT = 102,
554 VK_FORMAT_R32G32_SFLOAT = 103,
555 VK_FORMAT_R32G32B32_UINT = 104,
556 VK_FORMAT_R32G32B32_SINT = 105,
557 VK_FORMAT_R32G32B32_SFLOAT = 106,
558 VK_FORMAT_R32G32B32A32_UINT = 107,
559 VK_FORMAT_R32G32B32A32_SINT = 108,
560 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
561 VK_FORMAT_R64_UINT = 110,
562 VK_FORMAT_R64_SINT = 111,
563 VK_FORMAT_R64_SFLOAT = 112,
564 VK_FORMAT_R64G64_UINT = 113,
565 VK_FORMAT_R64G64_SINT = 114,
566 VK_FORMAT_R64G64_SFLOAT = 115,
567 VK_FORMAT_R64G64B64_UINT = 116,
568 VK_FORMAT_R64G64B64_SINT = 117,
569 VK_FORMAT_R64G64B64_SFLOAT = 118,
570 VK_FORMAT_R64G64B64A64_UINT = 119,
571 VK_FORMAT_R64G64B64A64_SINT = 120,
572 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
573 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
574 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
575 VK_FORMAT_D16_UNORM = 124,
576 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
577 VK_FORMAT_D32_SFLOAT = 126,
578 VK_FORMAT_S8_UINT = 127,
579 VK_FORMAT_D16_UNORM_S8_UINT = 128,
580 VK_FORMAT_D24_UNORM_S8_UINT = 129,
581 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
582 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
583 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
584 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
585 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
586 VK_FORMAT_BC2_UNORM_BLOCK = 135,
587 VK_FORMAT_BC2_SRGB_BLOCK = 136,
588 VK_FORMAT_BC3_UNORM_BLOCK = 137,
589 VK_FORMAT_BC3_SRGB_BLOCK = 138,
590 VK_FORMAT_BC4_UNORM_BLOCK = 139,
591 VK_FORMAT_BC4_SNORM_BLOCK = 140,
592 VK_FORMAT_BC5_UNORM_BLOCK = 141,
593 VK_FORMAT_BC5_SNORM_BLOCK = 142,
594 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
595 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
596 VK_FORMAT_BC7_UNORM_BLOCK = 145,
597 VK_FORMAT_BC7_SRGB_BLOCK = 146,
598 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
599 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
600 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
601 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
602 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
603 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
604 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
605 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
606 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
607 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
608 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
609 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
610 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
611 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
612 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
613 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
614 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
615 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
616 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
617 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
618 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
619 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
620 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
621 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
622 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
623 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
624 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
625 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
626 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
627 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
628 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
629 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
630 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
631 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
632 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
633 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
634 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
635 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Chris Forbes289cb792016-12-30 15:03:55 +1300636
637 //@extension("VK_IMG_format_pvrtc")
638 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
639
640 //@extension("VK_IMG_format_pvrtc")
641 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
642
643 //@extension("VK_IMG_format_pvrtc")
644 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
645
646 //@extension("VK_IMG_format_pvrtc")
647 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
648
649 //@extension("VK_IMG_format_pvrtc")
650 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
651
652 //@extension("VK_IMG_format_pvrtc")
653 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
654
655 //@extension("VK_IMG_format_pvrtc")
656 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
657
658 //@extension("VK_IMG_format_pvrtc")
659 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700660}
661
Jesse Halld27f6aa2015-08-15 17:58:48 -0700662/// Structure type enumerant
663enum VkStructureType {
664 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800665 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
666 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
667 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
668 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800669 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800670 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
671 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
672 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
673 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700674 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800675 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
676 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
677 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
678 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
679 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
680 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800681 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
682 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
683 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
684 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
685 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
686 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
687 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
688 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
689 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
690 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
691 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
692 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
693 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
694 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
695 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
696 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
697 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800698 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800699 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
700 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
701 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
702 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
703 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800704 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800705 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
706 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
707 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
708 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
709 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
710 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
711 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
712 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800713
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800714 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800715 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
716 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800717
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800718 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800719 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
720 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800721
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800722 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800723 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800724
725 //@extension("VK_KHR_xlib_surface")
726 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
727
728 //@extension("VK_KHR_xcb_surface")
729 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
730
731 //@extension("VK_KHR_wayland_surface")
732 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
733
734 //@extension("VK_KHR_mir_surface")
735 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
736
737 //@extension("VK_KHR_android_surface")
738 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
739
740 //@extension("VK_KHR_win32_surface")
741 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800742
Chia-I Wub262ddc2016-03-22 07:38:20 +0800743 //@extension("VK_ANDROID_native_buffer")
744 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300745 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800746
Jesse Hall543a7ff2016-01-08 16:38:30 -0800747 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700748 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
749
750 //@extension("VK_AMD_rasterization_order")
751 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
752
753 //@extension("VK_EXT_debug_marker")
754 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
755
756 //@extension("VK_EXT_debug_marker")
757 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
758
759 //@extension("VK_EXT_debug_marker")
760 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700761
762 //@extension("VK_NV_dedicated_allocation")
763 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
764
765 //@extension("VK_NV_dedicated_allocation")
766 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
767
768 //@extension("VK_NV_dedicated_allocation")
769 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300770
771 //@extension("VK_NV_external_memory")
772 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
773
774 //@extension("VK_NV_external_memory")
775 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
776
777 //@extension("VK_NV_external_memory_win32")
778 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
779
780 //@extension("VK_NV_external_memory_win32")
781 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
782
783 //@extension("VK_NV_win32_keyed_mutex")
784 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
785
786 //@extension("VK_EXT_validation_flags")
787 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
788
789 //@extension("VK_KHR_incremental_present")
790 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
791
792 //@extension("VK_NVX_device_generated_commands")
793 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
794
795 //@extension("VK_NVX_device_generated_commands")
796 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
797
798 //@extension("VK_NVX_device_generated_commands")
799 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
800
801 //@extension("VK_NVX_device_generated_commands")
802 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
803
804 //@extension("VK_NVX_device_generated_commands")
805 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
806
807 //@extension("VK_NVX_device_generated_commands")
808 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700809}
810
Jesse Hall65ab5522015-11-30 00:07:16 -0800811enum VkSubpassContents {
812 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
813 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700814}
815
Jesse Hall543a7ff2016-01-08 16:38:30 -0800816enum VkPipelineCacheHeaderVersion {
817 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
818}
819
Jesse Hallbd888842015-11-30 21:44:14 -0800820@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700821/// Error and return codes
822enum VkResult {
823 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800824 VK_SUCCESS = 0,
825 VK_NOT_READY = 1,
826 VK_TIMEOUT = 2,
827 VK_EVENT_SET = 3,
828 VK_EVENT_RESET = 4,
829 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700830
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800831 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800832 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800833
Jesse Halld27f6aa2015-08-15 17:58:48 -0700834 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800835 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
836 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
837 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
838 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
839 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
840 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
841 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
842 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
843 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
844 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
845 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700846 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800847
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800848 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800849 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800850
Jesse Hall563380d2016-01-15 23:14:05 -0800851 //@extension("VK_KHR_surface")
852 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
853
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800854 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800855 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800856
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800857 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800858 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800859
Jesse Hall543a7ff2016-01-08 16:38:30 -0800860 //@extension("VK_EXT_debug_report")
861 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700862
863 //@extension("VK_NV_glsl_shader")
864 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700865}
866
867enum VkDynamicState {
868 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
869 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
870 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
871 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
872 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
873 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
874 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
875 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
876 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700877}
878
Jesse Hall523db342015-11-30 21:12:55 -0800879@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800880enum VkPresentModeKHR {
881 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
882 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
883 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800884 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800885}
886
Jesse Hall523db342015-11-30 21:12:55 -0800887@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800888enum VkColorSpaceKHR {
889 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
890}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700891
Jesse Hall715b86a2016-01-16 16:34:29 -0800892@extension("VK_EXT_debug_report")
893enum VkDebugReportObjectTypeEXT {
894 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
895 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
896 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
897 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
898 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
899 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
900 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
901 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
902 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
903 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
904 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
905 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
906 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
907 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
908 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
909 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
910 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
911 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
912 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
913 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
914 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
915 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
916 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
917 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
918 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
919 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
920 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
921 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
922 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +1300923 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
924 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
925 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
926 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800927}
928
929@extension("VK_EXT_debug_report")
930enum VkDebugReportErrorEXT {
931 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
932 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
933}
934
Jesse Hall26763382016-05-20 07:13:52 -0700935@extension("VK_AMD_rasterization_order")
936enum VkRasterizationOrderAMD {
937 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
938 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
939}
940
Chris Forbes289cb792016-12-30 15:03:55 +1300941@extension("VK_EXT_validation_flags")
942enum VkValidationCheckEXT {
943 VK_VALIDATION_CHECK_ALL_EXT = 0,
944}
945
946@extension("VK_NVX_device_generated_commands")
947enum VkIndirectCommandsTokenTypeNVX {
948 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
949 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
950 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
951 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
952 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
953 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
954 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
955 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
956}
957
958@extension("VK_NVX_device_generated_commands")
959enum VkObjectEntryTypeNVX {
960 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
961 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
962 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
963 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
964 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
965}
Jesse Hall715b86a2016-01-16 16:34:29 -0800966
Jesse Halld27f6aa2015-08-15 17:58:48 -0700967/////////////////
968// Bitfields //
969/////////////////
970
Jesse Halld27f6aa2015-08-15 17:58:48 -0700971/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -0800972type VkFlags VkQueueFlags
973bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700974 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
975 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -0800976 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -0800977 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700978}
979
980/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -0800981type VkFlags VkMemoryPropertyFlags
982bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800983 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
984 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
985 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
986 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
987 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700988}
989
990/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -0800991type VkFlags VkMemoryHeapFlags
992bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800993 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700994}
995
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800996/// Access flags
997type VkFlags VkAccessFlags
998bitfield VkAccessFlagBits {
999 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1000 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1001 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1002 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1003 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1004 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1005 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1006 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1007 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1008 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1009 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1010 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1011 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1012 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1013 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1014 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1015 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001016
1017 //@extension("VK_NVX_device_generated_commands")
1018 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1019
1020 //@extension("VK_NVX_device_generated_commands")
1021 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001022}
1023
1024/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001025type VkFlags VkBufferUsageFlags
1026bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001027 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1028 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001029 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1030 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1031 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1032 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1033 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1034 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1035 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1036}
1037
1038/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001039type VkFlags VkBufferCreateFlags
1040bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001041 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001042 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1043 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1044}
1045
1046/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001047type VkFlags VkShaderStageFlags
1048bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001049 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001050 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1051 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001052 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1053 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1054 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001055 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001056
1057 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1058}
1059
Jesse Hallfbf97b02015-11-20 14:17:03 -08001060/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001061type VkFlags VkDescriptorPoolCreateFlags
1062bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001063 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1064}
1065
1066/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001067type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001068//bitfield VkDescriptorPoolResetFlagBits {
1069//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001070
Jesse Halld27f6aa2015-08-15 17:58:48 -07001071/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001072type VkFlags VkImageUsageFlags
1073bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001074 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1075 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001076 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1077 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1078 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001079 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001080 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1081 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1082}
1083
1084/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001085type VkFlags VkImageCreateFlags
1086bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001087 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001088 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1089 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 -07001090 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1091 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 -07001092}
1093
Jesse Hallb00daad2015-11-29 19:46:20 -08001094/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001095type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001096//bitfield VkImageViewCreateFlagBits {
1097//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001098
1099/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001100type VkFlags VkPipelineCreateFlags
1101bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001102 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1103 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1104 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1105}
1106
Jesse Hall65ab5522015-11-30 00:07:16 -08001107/// Color component flags
1108type VkFlags VkColorComponentFlags
1109bitfield VkColorComponentFlagBits {
1110 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1111 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1112 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1113 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001114}
1115
1116/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001117type VkFlags VkFenceCreateFlags
1118bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001119 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1120}
1121
1122/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001123type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001124//bitfield VkSemaphoreCreateFlagBits {
1125//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001126
1127/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001128type VkFlags VkFormatFeatureFlags
1129bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001130 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1131 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1132 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1133 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1134 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1135 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1136 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1137 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1138 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1139 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001140 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1141 VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCommandBlitImage
Jesse Hall33faaad2016-01-24 21:00:49 -08001142 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001143
1144 //@extension("VK_IMG_filter_cubic")
1145 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001146}
1147
1148/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001149type VkFlags VkQueryControlFlags
1150bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001151 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001152}
1153
1154/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001155type VkFlags VkQueryResultFlags
1156bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001157 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1158 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1159 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1160 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1161}
1162
1163/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001164type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001165//bitfield VkShaderModuleCreateFlagBits {
1166//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001167
Jesse Halld27f6aa2015-08-15 17:58:48 -07001168/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001169type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001170//bitfield VkEventCreateFlagBits {
1171//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001172
Jesse Halla15a4bf2015-11-19 22:48:02 -08001173/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001174type VkFlags VkCommandBufferUsageFlags
1175bitfield VkCommandBufferUsageFlagBits {
1176 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1177 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1178 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001179}
1180
1181/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001182type VkFlags VkQueryPipelineStatisticFlags
1183bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001184 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1185 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1186 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1187 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1188 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1189 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1190 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1191 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1192 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1193 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1194 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001195}
1196
1197/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001198type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001199//bitfield VkMemoryMapFlagBits {
1200//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001201
1202/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001203type VkFlags VkImageAspectFlags
1204bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001205 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1206 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1207 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1208 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1209}
1210
1211/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001212type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001213bitfield VkSparseMemoryBindFlagBits {
1214 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1215}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001216
1217/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001218type VkFlags VkSparseImageFormatFlags
1219bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001220 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1221 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.
1222 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001223}
1224
1225/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001226type VkFlags VkPipelineStageFlags
1227bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001228 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1229 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1230 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1231 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001232 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1233 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001234 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1235 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1236 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1237 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1238 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1239 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1240 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001241 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1242 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001243
Jesse Hall543a7ff2016-01-08 16:38:30 -08001244 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1245 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001246
1247 //@extension("VK_NVX_device_generated_commands")
1248 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001249}
1250
1251/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001252type VkFlags VkAttachmentDescriptionFlags
1253bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001254 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 -07001255}
1256
1257/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001258type VkFlags VkSubpassDescriptionFlags
1259bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001260}
1261
1262/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001263type VkFlags VkCommandPoolCreateFlags
1264bitfield VkCommandPoolCreateFlagBits {
1265 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1266 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001267}
1268
1269/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001270type VkFlags VkCommandPoolResetFlags
1271bitfield VkCommandPoolResetFlagBits {
1272 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001273}
1274
Jesse Hall3fbc8562015-11-29 22:10:52 -08001275type VkFlags VkCommandBufferResetFlags
1276bitfield VkCommandBufferResetFlagBits {
1277 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001278}
1279
Jesse Halld8bade02015-11-24 10:24:18 -08001280type VkFlags VkSampleCountFlags
1281bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001282 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1283 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1284 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1285 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1286 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1287 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1288 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1289}
1290
Jesse Halld8bade02015-11-24 10:24:18 -08001291type VkFlags VkStencilFaceFlags
1292bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001293 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1294 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001295 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001296}
1297
Jesse Halla6429252015-11-29 18:59:42 -08001298/// Instance creation flags
1299type VkFlags VkInstanceCreateFlags
1300//bitfield VkInstanceCreateFlagBits {
1301//}
1302
1303/// Device creation flags
1304type VkFlags VkDeviceCreateFlags
1305//bitfield VkDeviceCreateFlagBits {
1306//}
1307
1308/// Device queue creation flags
1309type VkFlags VkDeviceQueueCreateFlags
1310//bitfield VkDeviceQueueCreateFlagBits {
1311//}
1312
1313/// Query pool creation flags
1314type VkFlags VkQueryPoolCreateFlags
1315//bitfield VkQueryPoolCreateFlagBits {
1316//}
1317
1318/// Buffer view creation flags
1319type VkFlags VkBufferViewCreateFlags
1320//bitfield VkBufferViewCreateFlagBits {
1321//}
1322
1323/// Pipeline cache creation flags
1324type VkFlags VkPipelineCacheCreateFlags
1325//bitfield VkPipelineCacheCreateFlagBits {
1326//}
1327
1328/// Pipeline shader stage creation flags
1329type VkFlags VkPipelineShaderStageCreateFlags
1330//bitfield VkPipelineShaderStageCreateFlagBits {
1331//}
1332
1333/// Descriptor set layout creation flags
1334type VkFlags VkDescriptorSetLayoutCreateFlags
1335//bitfield VkDescriptorSetLayoutCreateFlagBits {
1336//}
1337
1338/// Pipeline vertex input state creation flags
1339type VkFlags VkPipelineVertexInputStateCreateFlags
1340//bitfield VkPipelineVertexInputStateCreateFlagBits {
1341//}
1342
1343/// Pipeline input assembly state creation flags
1344type VkFlags VkPipelineInputAssemblyStateCreateFlags
1345//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1346//}
1347
1348/// Tessellation state creation flags
1349type VkFlags VkPipelineTessellationStateCreateFlags
1350//bitfield VkPipelineTessellationStateCreateFlagBits {
1351//}
1352
1353/// Viewport state creation flags
1354type VkFlags VkPipelineViewportStateCreateFlags
1355//bitfield VkPipelineViewportStateCreateFlagBits {
1356//}
1357
Jesse Hall3fbc8562015-11-29 22:10:52 -08001358/// Rasterization state creation flags
1359type VkFlags VkPipelineRasterizationStateCreateFlags
1360//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001361//}
1362
1363/// Multisample state creation flags
1364type VkFlags VkPipelineMultisampleStateCreateFlags
1365//bitfield VkPipelineMultisampleStateCreateFlagBits {
1366//}
1367
1368/// Color blend state creation flags
1369type VkFlags VkPipelineColorBlendStateCreateFlags
1370//bitfield VkPipelineColorBlendStateCreateFlagBits {
1371//}
1372
1373/// Depth/stencil state creation flags
1374type VkFlags VkPipelineDepthStencilStateCreateFlags
1375//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1376//}
1377
1378/// Dynamic state creation flags
1379type VkFlags VkPipelineDynamicStateCreateFlags
1380//bitfield VkPipelineDynamicStateCreateFlagBits {
1381//}
1382
1383/// Pipeline layout creation flags
1384type VkFlags VkPipelineLayoutCreateFlags
1385//bitfield VkPipelineLayoutCreateFlagBits {
1386//}
1387
1388/// Sampler creation flags
1389type VkFlags VkSamplerCreateFlags
1390//bitfield VkSamplerCreateFlagBits {
1391//}
1392
1393/// Render pass creation flags
1394type VkFlags VkRenderPassCreateFlags
1395//bitfield VkRenderPassCreateFlagBits {
1396//}
1397
1398/// Framebuffer creation flags
1399type VkFlags VkFramebufferCreateFlags
1400//bitfield VkFramebufferCreateFlagBits {
1401//}
1402
Jesse Halldc6d36c2015-11-29 19:12:15 -08001403/// Dependency flags
1404type VkFlags VkDependencyFlags
1405bitfield VkDependencyFlagBits {
1406 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1407}
1408
Jesse Hallc7467b72015-11-29 21:05:26 -08001409/// Cull mode flags
1410type VkFlags VkCullModeFlags
1411bitfield VkCullModeFlagBits {
1412 VK_CULL_MODE_NONE = 0x00000000,
1413 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1414 VK_CULL_MODE_BACK_BIT = 0x00000002,
1415 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1416}
1417
Jesse Hall523db342015-11-30 21:12:55 -08001418@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001419type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001420@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001421bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001422 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001423 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1424 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1425 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1426 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1427 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1428 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1429 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1430 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001431}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001432
Jesse Hall523db342015-11-30 21:12:55 -08001433@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001434type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001435@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001436bitfield VkCompositeAlphaFlagBitsKHR {
1437 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1438 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1439 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1440 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1441}
1442
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001443@extension("VK_KHR_swapchain")
1444type VkFlags VkSwapchainCreateFlagsKHR
1445//@extension("VK_KHR_swapchain")
1446//bitfield VkSwapchainCreateFlagBitsKHR {
1447//}
1448
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001449@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001450type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001451@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001452bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001453 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1454 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1455 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1456 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001457}
1458
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001459@extension("VK_KHR_display")
1460type VkFlags VkDisplaySurfaceCreateFlagsKHR
1461//@extension("VK_KHR_display")
1462//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1463//}
1464
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001465@extension("VK_KHR_display")
1466type VkFlags VkDisplayModeCreateFlagsKHR
1467//@extension("VK_KHR_display")
1468//bitfield VkDisplayModeCreateFlagBitsKHR {
1469//}
1470
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001471@extension("VK_KHR_xlib_surface")
1472type VkFlags VkXlibSurfaceCreateFlagsKHR
1473//@extension("VK_KHR_xlib_surface")
1474//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1475//}
1476
1477@extension("VK_KHR_xcb_surface")
1478type VkFlags VkXcbSurfaceCreateFlagsKHR
1479//@extension("VK_KHR_xcb_surface")
1480//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1481//}
1482
1483@extension("VK_KHR_wayland_surface")
1484type VkFlags VkWaylandSurfaceCreateFlagsKHR
1485//@extension("VK_KHR_wayland_surface")
1486//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1487//}
1488
1489@extension("VK_KHR_mir_surface")
1490type VkFlags VkMirSurfaceCreateFlagsKHR
1491//@extension("VK_KHR_mir_surface")
1492//bitfield VkMirSurfaceCreateFlagBitsKHR {
1493//}
1494
1495@extension("VK_KHR_android_surface")
1496type VkFlags VkAndroidSurfaceCreateFlagsKHR
1497//@extension("VK_KHR_android_surface")
1498//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1499//}
1500
1501@extension("VK_KHR_win32_surface")
1502type VkFlags VkWin32SurfaceCreateFlagsKHR
1503//@extension("VK_KHR_win32_surface")
1504//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1505//}
1506
Jesse Hall715b86a2016-01-16 16:34:29 -08001507@extension("VK_EXT_debug_report")
1508type VkFlags VkDebugReportFlagsEXT
1509@extension("VK_EXT_debug_report")
1510bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001511 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1512 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1513 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001514 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1515 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1516}
1517
Chris Forbes8e4438b2016-12-07 16:26:49 +13001518@extension("VK_ANDROID_native_buffer")
1519type VkFlags VkSwapchainImageUsageFlagsANDROID
1520@extension("VK_ANDROID_native_buffer")
1521bitfield VkSwapchainImageUsageFlagBitsANDROID {
1522 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_FRONT_BUFFER_BIT_ANDROID = 0x00000001,
1523}
1524
Chris Forbes289cb792016-12-30 15:03:55 +13001525@extension("VK_NV_external_memory_capabilities")
1526type VkFlags VkExternalMemoryHandleTypeFlagsNV
1527@extension("VK_NV_external_memory_capabilities")
1528bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1529 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1530 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1531 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1532 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1533}
1534
1535@extension("VK_NV_external_memory_capabilities")
1536type VkFlags VkExternalMemoryFeatureFlagsNV
1537@extension("VK_NV_external_memory_capabilities")
1538bitfield VkExternalMemoryFeatureFlagBitsNV {
1539 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1540 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1541 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1542}
1543
1544@extension("VK_NVX_device_generated_commands")
1545type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1546@extension("VK_NVX_device_generated_commands")
1547bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1548 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1549 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1550 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1551 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1552}
1553
1554@extension("VK_NVX_device_generated_commands")
1555type VkFlags VkObjectEntryUsageFlagsNVX
1556@extension("VK_NVX_device_generated_commands")
1557bitfield VkObjectEntryUsageFlagBitsNVX {
1558 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1559 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1560}
1561
Jesse Hall1356b0d2015-11-23 17:24:58 -08001562
Jesse Halld27f6aa2015-08-15 17:58:48 -07001563//////////////////
1564// Structures //
1565//////////////////
1566
1567class VkOffset2D {
1568 s32 x
1569 s32 y
1570}
1571
1572class VkOffset3D {
1573 s32 x
1574 s32 y
1575 s32 z
1576}
1577
1578class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001579 u32 width
1580 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001581}
1582
1583class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001584 u32 width
1585 u32 height
1586 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001587}
1588
1589class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001590 f32 x
1591 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001592 f32 width
1593 f32 height
1594 f32 minDepth
1595 f32 maxDepth
1596}
1597
1598class VkRect2D {
1599 VkOffset2D offset
1600 VkExtent2D extent
1601}
1602
Jesse Halla15a4bf2015-11-19 22:48:02 -08001603class VkClearRect {
1604 VkRect2D rect
1605 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001606 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001607}
1608
Jesse Hall65ab5522015-11-30 00:07:16 -08001609class VkComponentMapping {
1610 VkComponentSwizzle r
1611 VkComponentSwizzle g
1612 VkComponentSwizzle b
1613 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001614}
1615
1616class VkPhysicalDeviceProperties {
1617 u32 apiVersion
1618 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001619 u32 vendorID
1620 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001621 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001622 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1623 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001624 VkPhysicalDeviceLimits limits
1625 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001626}
1627
1628class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001629 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001630 u32 specVersion /// version of the extension specification implemented
1631}
1632
1633class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001634 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001635 u32 specVersion /// version of the layer specification implemented
1636 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001637 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001638}
1639
Jesse Halla366a512015-11-19 22:30:07 -08001640class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001641 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1642 const void* pNext /// Next structure in chain
1643 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001644 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001645 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001646 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001647 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001648 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001649 const VkSemaphore* pSignalSemaphores
1650}
1651
Jesse Halld27f6aa2015-08-15 17:58:48 -07001652class VkApplicationInfo {
1653 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1654 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001655 const char* pApplicationName
1656 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001657 const char* pEngineName
1658 u32 engineVersion
1659 u32 apiVersion
1660}
1661
Jesse Hall3fbc8562015-11-29 22:10:52 -08001662class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001663 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001664 PFN_vkAllocationFunction pfnAllocation
1665 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001666 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001667 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001668 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001669}
1670
1671class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001672 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1673 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001674 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001675 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001676 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001677 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001678}
1679
1680class VkDeviceCreateInfo {
1681 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1682 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001683 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001684 u32 queueCreateInfoCount
1685 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001686 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001687 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001688 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001689 const char* const* ppEnabledExtensionNames
1690 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001691}
1692
1693class VkInstanceCreateInfo {
1694 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1695 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001696 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001697 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001698 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001699 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001700 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001701 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1702}
1703
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001704class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001705 VkQueueFlags queueFlags /// Queue flags
1706 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001707 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001708 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001709}
1710
1711class VkPhysicalDeviceMemoryProperties {
1712 u32 memoryTypeCount
1713 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1714 u32 memoryHeapCount
1715 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1716}
1717
Jesse Hall3fbc8562015-11-29 22:10:52 -08001718class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001719 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001720 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001721 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001722 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1723}
1724
1725class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001726 VkDeviceSize size /// Specified in bytes
1727 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001728 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1729}
1730
1731class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001732 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001733 VkExtent3D imageGranularity
1734 VkSparseImageFormatFlags flags
1735}
1736
1737class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001738 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001739 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001740 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1741 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1742 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001743}
1744
1745class VkMemoryType {
1746 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1747 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1748}
1749
1750class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001751 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001752 VkMemoryHeapFlags flags /// Flags for the heap
1753}
1754
1755class VkMappedMemoryRange {
1756 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1757 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001758 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001759 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1760 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001761}
1762
1763class VkFormatProperties {
1764 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1765 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001766 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001767}
1768
1769class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001770 VkExtent3D maxExtent /// max image dimensions for this resource type
1771 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001772 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001773 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1774 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1775}
1776
Jesse Halla15a4bf2015-11-19 22:48:02 -08001777class VkDescriptorImageInfo {
1778 VkSampler sampler
1779 VkImageView imageView
1780 VkImageLayout imageLayout
1781}
1782
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001783class VkDescriptorBufferInfo {
1784 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1785 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1786 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001787}
1788
Jesse Halld27f6aa2015-08-15 17:58:48 -07001789class VkWriteDescriptorSet {
1790 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1791 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001792 VkDescriptorSet dstSet /// Destination descriptor set
1793 u32 dstBinding /// Binding within the destination descriptor set to write
1794 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001795 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001796 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 -08001797 const VkDescriptorImageInfo* pImageInfo
1798 const VkDescriptorBufferInfo* pBufferInfo
1799 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001800}
1801
1802class VkCopyDescriptorSet {
1803 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1804 const void* pNext /// Pointer to next structure
1805 VkDescriptorSet srcSet /// Source descriptor set
1806 u32 srcBinding /// Binding within the source descriptor set to copy from
1807 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001808 VkDescriptorSet dstSet /// Destination descriptor set
1809 u32 dstBinding /// Binding within the destination descriptor set to copy to
1810 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001811 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001812}
1813
1814class VkBufferCreateInfo {
1815 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1816 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001817 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001818 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001819 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001820 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001821 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001822 const u32* pQueueFamilyIndices
1823}
1824
1825class VkBufferViewCreateInfo {
1826 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1827 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001828 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001829 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001830 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001831 VkDeviceSize offset /// Specified in bytes
1832 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001833}
1834
1835class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001836 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001837 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001838 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001839}
1840
1841class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001842 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001843 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001844 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001845 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001846 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001847}
1848
1849class VkMemoryBarrier {
1850 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1851 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001852 VkAccessFlags srcAccessMask
1853 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001854}
1855
1856class VkBufferMemoryBarrier {
1857 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1858 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001859 VkAccessFlags srcAccessMask
1860 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001861 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001862 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001863 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001864 VkDeviceSize offset /// Offset within the buffer to sync
1865 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001866}
1867
1868class VkImageMemoryBarrier {
1869 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1870 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001871 VkAccessFlags srcAccessMask
1872 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001873 VkImageLayout oldLayout /// Current layout of the image
1874 VkImageLayout newLayout /// New layout to transition the image to
1875 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001876 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001877 VkImage image /// Image to sync
1878 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1879}
1880
1881class VkImageCreateInfo {
1882 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1883 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001884 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001885 VkImageType imageType
1886 VkFormat format
1887 VkExtent3D extent
1888 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001889 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001890 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001891 VkImageTiling tiling
1892 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001893 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001894 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001895 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001896 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001897}
1898
1899class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001900 VkDeviceSize offset /// Specified in bytes
1901 VkDeviceSize size /// Specified in bytes
1902 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001903 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001904 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001905}
1906
1907class VkImageViewCreateInfo {
1908 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1909 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001910 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001911 VkImage image
1912 VkImageViewType viewType
1913 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001914 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001915 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001916}
1917
1918class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001919 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001920 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001921 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001922}
1923
Jesse Halla6429252015-11-29 18:59:42 -08001924class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001925 VkDeviceSize resourceOffset /// Specified in bytes
1926 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001927 VkDeviceMemory memory
1928 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001929 VkSparseMemoryBindFlags flags
1930}
1931
Jesse Halla6429252015-11-29 18:59:42 -08001932class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001933 VkImageSubresource subresource
1934 VkOffset3D offset
1935 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001936 VkDeviceMemory memory
1937 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001938 VkSparseMemoryBindFlags flags
1939}
1940
Jesse Halla6429252015-11-29 18:59:42 -08001941class VkSparseBufferMemoryBindInfo {
1942 VkBuffer buffer
1943 u32 bindCount
1944 const VkSparseMemoryBind* pBinds
1945}
1946
1947class VkSparseImageOpaqueMemoryBindInfo {
1948 VkImage image
1949 u32 bindCount
1950 const VkSparseMemoryBind* pBinds
1951}
1952
1953class VkSparseImageMemoryBindInfo {
1954 VkImage image
1955 u32 bindCount
1956 const VkSparseMemoryBind* pBinds
1957}
1958
1959class VkBindSparseInfo {
1960 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1961 const void* pNext
1962 u32 waitSemaphoreCount
1963 const VkSemaphore* pWaitSemaphores
1964 u32 numBufferBinds
1965 const VkSparseBufferMemoryBindInfo* pBufferBinds
1966 u32 numImageOpaqueBinds
1967 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1968 u32 numImageBinds
1969 const VkSparseImageMemoryBindInfo* pImageBinds
1970 u32 signalSemaphoreCount
1971 const VkSemaphore* pSignalSemaphores
1972}
1973
Jesse Hall65ab5522015-11-30 00:07:16 -08001974class VkImageSubresourceLayers {
1975 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001976 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001977 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001978 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001979}
1980
Jesse Halld27f6aa2015-08-15 17:58:48 -07001981class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001982 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001983 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001984 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001985 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001986 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1987}
1988
1989class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001990 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001991 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08001992 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001993 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07001994}
1995
1996class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001997 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001998 u32 bufferRowLength /// Specified in texels
1999 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002000 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002001 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2002 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2003}
2004
2005class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002006 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002007 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002008 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002009 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002010 VkExtent3D extent
2011}
2012
2013class VkShaderModuleCreateInfo {
2014 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2015 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002016 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002017 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002018 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002019}
2020
Jesse Halld27f6aa2015-08-15 17:58:48 -07002021class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002022 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002023 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002024 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002025 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2026 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2027}
2028
2029class VkDescriptorSetLayoutCreateInfo {
2030 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2031 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002032 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002033 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002034 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002035}
2036
Jesse Hall65ab5522015-11-30 00:07:16 -08002037class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002038 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002039 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002040}
2041
2042class VkDescriptorPoolCreateInfo {
2043 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2044 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002045 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002046 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002047 u32 poolSizeCount
2048 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002049}
2050
Jesse Hall3fbc8562015-11-29 22:10:52 -08002051class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002052 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002053 const void* pNext /// Pointer to next structure
2054 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002055 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002056 const VkDescriptorSetLayout* pSetLayouts
2057}
2058
Jesse Halld27f6aa2015-08-15 17:58:48 -07002059class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002060 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002061 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002062 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002063}
2064
2065class VkSpecializationInfo {
2066 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002067 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002068 platform.size_t dataSize /// Size in bytes of pData
2069 const void* pData /// Pointer to SpecConstant data
2070}
2071
2072class VkPipelineShaderStageCreateInfo {
2073 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2074 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002075 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002076 VkShaderStageFlagBits stage
2077 VkShaderModule module
2078 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002079 const VkSpecializationInfo* pSpecializationInfo
2080}
2081
2082class VkComputePipelineCreateInfo {
2083 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2084 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002085 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002086 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002087 VkPipelineLayout layout /// Interface layout of the pipeline
2088 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
2089 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
2090}
2091
2092class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002093 u32 binding /// Vertex buffer binding id
2094 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002095 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002096}
2097
2098class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002099 u32 location /// location of the shader vertex attrib
2100 u32 binding /// Vertex buffer binding id
2101 VkFormat format /// format of source data
2102 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002103}
2104
2105class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002106 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2107 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002108 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002109 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002110 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002111 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002112 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2113}
2114
2115class VkPipelineInputAssemblyStateCreateInfo {
2116 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2117 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002118 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002119 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002120 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002121}
2122
2123class VkPipelineTessellationStateCreateInfo {
2124 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2125 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002126 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002127 u32 patchControlPoints
2128}
2129
2130class VkPipelineViewportStateCreateInfo {
2131 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2132 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002133 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002134 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002135 const VkViewport* pViewports
2136 u32 scissorCount
2137 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002138}
2139
Jesse Hall3fbc8562015-11-29 22:10:52 -08002140class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002141 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002142 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002143 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002144 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002145 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002146 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002147 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002148 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002149 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002150 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002151 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002152 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002153 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002154}
2155
2156class VkPipelineMultisampleStateCreateInfo {
2157 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2158 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002159 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002160 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002161 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002162 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002163 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002164 VkBool32 alphaToCoverageEnable
2165 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002166}
2167
2168class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002169 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002170 VkBlendFactor srcColorBlendFactor
2171 VkBlendFactor dstColorBlendFactor
2172 VkBlendOp colorBlendOp
2173 VkBlendFactor srcAlphaBlendFactor
2174 VkBlendFactor dstAlphaBlendFactor
2175 VkBlendOp alphaBlendOp
2176 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002177}
2178
2179class VkPipelineColorBlendStateCreateInfo {
2180 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2181 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002182 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002183 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002184 VkLogicOp logicOp
2185 u32 attachmentCount /// # of pAttachments
2186 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002187 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002188}
2189
2190class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002191 VkStencilOp failOp
2192 VkStencilOp passOp
2193 VkStencilOp depthFailOp
2194 VkCompareOp compareOp
2195 u32 compareMask
2196 u32 writeMask
2197 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002198}
2199
2200class VkPipelineDepthStencilStateCreateInfo {
2201 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2202 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002203 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002204 VkBool32 depthTestEnable
2205 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002206 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002207 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2208 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002209 VkStencilOpState front
2210 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002211 f32 minDepthBounds
2212 f32 maxDepthBounds
2213}
2214
2215class VkPipelineDynamicStateCreateInfo {
2216 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2217 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002218 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002219 u32 dynamicStateCount
2220 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002221}
2222
2223class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002224 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2225 const void* pNext /// Pointer to next structure
2226 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002227 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002228 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002229 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2230 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2231 const VkPipelineTessellationStateCreateInfo* pTessellationState
2232 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002233 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002234 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2235 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2236 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002237 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002238 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002239 VkRenderPass renderPass
2240 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002241 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
2242 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 -07002243}
2244
2245class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002246 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2247 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002248 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002249 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2250 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002251}
2252
2253class VkPushConstantRange {
2254 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002255 u32 offset /// Start of the range, in bytes
2256 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002257}
2258
2259class VkPipelineLayoutCreateInfo {
2260 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2261 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002262 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002263 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002264 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2265 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2266 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2267}
2268
2269class VkSamplerCreateInfo {
2270 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2271 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002272 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002273 VkFilter magFilter /// Filter mode for magnification
2274 VkFilter minFilter /// Filter mode for minifiation
2275 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2276 VkSamplerAddressMode addressModeU
2277 VkSamplerAddressMode addressModeV
2278 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002279 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002280 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002281 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002282 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002283 VkCompareOp compareOp
2284 f32 minLod
2285 f32 maxLod
2286 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002287 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002288}
2289
Jesse Hall3fbc8562015-11-29 22:10:52 -08002290class VkCommandPoolCreateInfo {
2291 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002292 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002293 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002294 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002295}
2296
Jesse Hall3fbc8562015-11-29 22:10:52 -08002297class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002298 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002299 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002300 VkCommandPool commandPool
2301 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002302 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002303}
2304
Jesse Hall3dd678a2016-01-08 21:52:01 -08002305class VkCommandBufferInheritanceInfo {
2306 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002307 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002308 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002309 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002310 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002311 VkBool32 occlusionQueryEnable
2312 VkQueryControlFlags queryFlags
2313 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002314}
2315
Jesse Hall3dd678a2016-01-08 21:52:01 -08002316class VkCommandBufferBeginInfo {
2317 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2318 const void* pNext /// Pointer to next structure
2319 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2320 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2321}
2322
Jesse Halld27f6aa2015-08-15 17:58:48 -07002323class VkRenderPassBeginInfo {
2324 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2325 const void* pNext /// Pointer to next structure
2326 VkRenderPass renderPass
2327 VkFramebuffer framebuffer
2328 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002329 u32 clearValueCount
2330 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002331}
2332
2333@union
2334/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2335class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002336 f32[4] float32
2337 s32[4] int32
2338 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002339}
2340
2341class VkClearDepthStencilValue {
2342 f32 depth
2343 u32 stencil
2344}
2345
2346@union
2347/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2348class VkClearValue {
2349 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002350 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002351}
2352
Jesse Hallae38f732015-11-19 21:32:50 -08002353class VkClearAttachment {
2354 VkImageAspectFlags aspectMask
2355 u32 colorAttachment
2356 VkClearValue clearValue
2357}
2358
Jesse Halld27f6aa2015-08-15 17:58:48 -07002359class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002360 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002361 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002362 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002363 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2364 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2365 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2366 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2367 VkImageLayout initialLayout
2368 VkImageLayout finalLayout
2369}
2370
2371class VkAttachmentReference {
2372 u32 attachment
2373 VkImageLayout layout
2374}
2375
2376class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002377 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002378 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002379 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002380 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002381 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002382 const VkAttachmentReference* pColorAttachments
2383 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002384 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002385 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002386 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002387}
2388
2389class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002390 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002391 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002392 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002393 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002394 VkAccessFlags srcAccessMask
2395 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002396 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002397}
2398
2399class VkRenderPassCreateInfo {
2400 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2401 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002402 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002403 u32 attachmentCount
2404 const VkAttachmentDescription* pAttachments
2405 u32 subpassCount
2406 const VkSubpassDescription* pSubpasses
2407 u32 dependencyCount
2408 const VkSubpassDependency* pDependencies
2409}
2410
2411class VkEventCreateInfo {
2412 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2413 const void* pNext /// Pointer to next structure
2414 VkEventCreateFlags flags /// Event creation flags
2415}
2416
2417class VkFenceCreateInfo {
2418 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2419 const void* pNext /// Pointer to next structure
2420 VkFenceCreateFlags flags /// Fence creation flags
2421}
2422
2423class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002424 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2425 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2426 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2427 VkBool32 independentBlend /// blending operations are controlled per-attachment
2428 VkBool32 geometryShader /// geometry stage
2429 VkBool32 tessellationShader /// tessellation control and evaluation stage
2430 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002431 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002432 VkBool32 logicOp /// logic operations
2433 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002434 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002435 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002436 VkBool32 depthBiasClamp /// depth bias clamping
2437 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2438 VkBool32 depthBounds /// depth bounds test
2439 VkBool32 wideLines /// lines with width greater than 1
2440 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002441 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2442 VkBool32 multiViewport
2443 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002444 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2445 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2446 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002447 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002448 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002449 VkBool32 vertexPipelineStoresAndAtomics
2450 VkBool32 fragmentStoresAndAtomics
2451 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002452 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2453 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2454 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002455 VkBool32 shaderStorageImageReadWithoutFormat
2456 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002457 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2458 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2459 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2460 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2461 VkBool32 shaderClipDistance /// clip distance in shaders
2462 VkBool32 shaderCullDistance /// cull distance in shaders
2463 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2464 VkBool32 shaderInt64 /// 64-bit integers in shaders
2465 VkBool32 shaderInt16 /// 16-bit integers in shaders
2466 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002467 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002468 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2469 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2470 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2471 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2472 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2473 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2474 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2475 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2476 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002477 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002478 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002479}
2480
2481class VkPhysicalDeviceLimits {
2482 /// resource maximum sizes
2483 u32 maxImageDimension1D /// max 1D image dimension
2484 u32 maxImageDimension2D /// max 2D image dimension
2485 u32 maxImageDimension3D /// max 3D image dimension
2486 u32 maxImageDimensionCube /// max cubemap image dimension
2487 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002488 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002489 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2490 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002491 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2492 /// memory limits
2493 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002494 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002495 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2496 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002497 /// descriptor set limits
2498 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002499 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2500 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2501 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2502 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2503 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002504 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002505 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002506 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2507 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002508 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002509 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002510 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002511 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2512 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002513 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002514 /// vertex stage limits
2515 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002516 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002517 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2518 u32 maxVertexInputBindingStride /// max vertex input binding stride
2519 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2520 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002521 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002522 u32 maxTessellationPatchSize /// max patch size (vertices)
2523 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2524 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2525 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2526 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2527 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2528 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002529 /// geometry stage limits
2530 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2531 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2532 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2533 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2534 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2535 /// fragment stage limits
2536 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002537 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002538 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002539 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2540 /// compute stage limits
2541 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2542 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2543 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2544 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2545
2546 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2547 u32 subTexelPrecisionBits /// num bits of subtexel precision
2548 u32 mipmapPrecisionBits /// num bits of mipmap precision
2549
2550 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002551 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002552
2553 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2554 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2555
2556 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002557 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2558 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2559 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2560
Jesse Halldc6d36c2015-11-29 19:12:15 -08002561 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2562 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2563 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2564 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002565
Jesse Hallfbf97b02015-11-20 14:17:03 -08002566 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002567 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002568 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002569 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2570 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2571 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2572 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2573
2574 u32 maxFramebufferWidth /// max width for a framebuffer
2575 u32 maxFramebufferHeight /// max height for a framebuffer
2576 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002577 VkSampleCountFlags framebufferColorSampleCounts
2578 VkSampleCountFlags framebufferDepthSampleCounts
2579 VkSampleCountFlags framebufferStencilSampleCounts
2580 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002581 u32 maxColorAttachments /// max num of framebuffer color attachments
2582
Jesse Hall091ed9e2015-11-30 00:55:29 -08002583 VkSampleCountFlags sampledImageColorSampleCounts
2584 VkSampleCountFlags sampledImageIntegerSampleCounts
2585 VkSampleCountFlags sampledImageDepthSampleCounts
2586 VkSampleCountFlags sampledImageStencilSampleCounts
2587 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002588 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002589 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002590
Jesse Halla9bb62b2015-11-21 19:31:56 -08002591 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002592
2593 u32 maxClipDistances /// max number of clip distances
2594 u32 maxCullDistances /// max number of cull distances
2595 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2596
Jesse Hallfbf97b02015-11-20 14:17:03 -08002597 u32 discreteQueuePriorities
2598
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002599 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2600 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002601 f32 pointSizeGranularity /// granularity of supported point sizes
2602 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002603 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002604 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002605
Jesse Hall65ab5522015-11-30 00:07:16 -08002606 VkDeviceSize optimalBufferCopyOffsetAlignment
2607 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002608 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002609}
2610
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002611class VkPhysicalDeviceSparseProperties {
2612 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 -08002613 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 -07002614 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2615 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 -07002616 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
2617}
2618
Jesse Halld27f6aa2015-08-15 17:58:48 -07002619class VkSemaphoreCreateInfo {
2620 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2621 const void* pNext /// Pointer to next structure
2622 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2623}
2624
2625class VkQueryPoolCreateInfo {
2626 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2627 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002628 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002629 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002630 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002631 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2632}
2633
2634class VkFramebufferCreateInfo {
2635 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2636 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002637 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002638 VkRenderPass renderPass
2639 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002640 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002641 u32 width
2642 u32 height
2643 u32 layers
2644}
2645
Jesse Hall3fbc8562015-11-29 22:10:52 -08002646class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002647 u32 vertexCount
2648 u32 instanceCount
2649 u32 firstVertex
2650 u32 firstInstance
2651}
2652
Jesse Hall3fbc8562015-11-29 22:10:52 -08002653class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002654 u32 indexCount
2655 u32 instanceCount
2656 u32 firstIndex
2657 s32 vertexOffset
2658 u32 firstInstance
2659}
2660
Jesse Hall3fbc8562015-11-29 22:10:52 -08002661class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002662 u32 x
2663 u32 y
2664 u32 z
2665}
2666
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002667@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002668class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002669 u32 minImageCount
2670 u32 maxImageCount
2671 VkExtent2D currentExtent
2672 VkExtent2D minImageExtent
2673 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002674 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002675 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002676 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002677 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002678 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002679}
2680
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002681@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002682class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002683 VkFormat format
2684 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002685}
2686
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002687@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002688class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002689 VkStructureType sType
2690 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002691 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002692 VkSurfaceKHR surface
2693 u32 minImageCount
2694 VkFormat imageFormat
2695 VkColorSpaceKHR imageColorSpace
2696 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002697 u32 imageArrayLayers
2698 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002699 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002700 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002701 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002702 VkSurfaceTransformFlagBitsKHR preTransform
2703 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002704 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002705 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002706 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002707}
2708
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002709@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002710class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002711 VkStructureType sType
2712 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002713 u32 waitSemaphoreCount
2714 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002715 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002716 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002717 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002718 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002719}
2720
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002721@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002722class VkDisplayPropertiesKHR {
2723 VkDisplayKHR display
2724 const char* displayName
2725 VkExtent2D physicalDimensions
2726 VkExtent2D physicalResolution
2727 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002728 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002729 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002730}
2731
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002732@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002733class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002734 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002735 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002736}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002737
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002738@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002739class VkDisplayModePropertiesKHR {
2740 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002741 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002742}
2743
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002744@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002745class VkDisplayModeCreateInfoKHR {
2746 VkStructureType sType
2747 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002748 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002749 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002750}
2751
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002752@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002753class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002754 VkDisplayKHR currentDisplay
2755 u32 currentStackIndex
2756}
2757
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002758@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002759class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002760 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2761 VkOffset2D minSrcPosition
2762 VkOffset2D maxSrcPosition
2763 VkExtent2D minSrcExtent
2764 VkExtent2D maxSrcExtent
2765 VkOffset2D minDstPosition
2766 VkOffset2D maxDstPosition
2767 VkExtent2D minDstExtent
2768 VkExtent2D maxDstExtent
2769}
2770
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002771@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002772class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002773 VkStructureType sType
2774 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002775 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002776 VkDisplayModeKHR displayMode
2777 u32 planeIndex
2778 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002779 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002780 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002781 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2782 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002783}
2784
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002785@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002786class VkDisplayPresentInfoKHR {
2787 VkStructureType sType
2788 const void* pNext
2789 VkRect2D srcRect
2790 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002791 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002792}
2793
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002794@extension("VK_KHR_xlib_surface")
2795class VkXlibSurfaceCreateInfoKHR {
2796 VkStructureType sType
2797 const void* pNext
2798 VkXlibSurfaceCreateFlagsKHR flags
2799 platform.Display* dpy
2800 platform.Window window
2801}
2802
2803@extension("VK_KHR_xcb_surface")
2804class VkXcbSurfaceCreateInfoKHR {
2805 VkStructureType sType
2806 const void* pNext
2807 VkXcbSurfaceCreateFlagsKHR flags
2808 platform.xcb_connection_t* connection
2809 platform.xcb_window_t window
2810}
2811
2812@extension("VK_KHR_wayland_surface")
2813class VkWaylandSurfaceCreateInfoKHR {
2814 VkStructureType sType
2815 const void* pNext
2816 VkWaylandSurfaceCreateFlagsKHR flags
2817 platform.wl_display* display
2818 platform.wl_surface* surface
2819}
2820
2821@extension("VK_KHR_mir_surface")
2822class VkMirSurfaceCreateInfoKHR {
2823 VkStructureType sType
2824 const void* pNext
2825 VkMirSurfaceCreateFlagsKHR flags
2826 platform.MirConnection* connection
2827 platform.MirSurface* mirSurface
2828}
2829
2830@extension("VK_KHR_android_surface")
2831class VkAndroidSurfaceCreateInfoKHR {
2832 VkStructureType sType
2833 const void* pNext
2834 VkAndroidSurfaceCreateFlagsKHR flags
2835 platform.ANativeWindow* window
2836}
2837
2838@extension("VK_KHR_win32_surface")
2839class VkWin32SurfaceCreateInfoKHR {
2840 VkStructureType sType
2841 const void* pNext
2842 VkWin32SurfaceCreateFlagsKHR flags
2843 platform.HINSTANCE hinstance
2844 platform.HWND hwnd
2845}
2846
Chia-I Wub262ddc2016-03-22 07:38:20 +08002847@extension("VK_ANDROID_native_buffer")
2848class VkNativeBufferANDROID {
2849 VkStructureType sType
2850 const void* pNext
2851 platform.buffer_handle_t handle
2852 int stride
2853 int format
2854 int usage
2855}
2856
Chris Forbes8e4438b2016-12-07 16:26:49 +13002857@extension("VK_ANDROID_native_buffer")
2858class VkSwapchainImageCreateInfoANDROID {
2859 VkStructureType sType
2860 const void* pNext
2861 VkSwapchainImageUsageFlagBitsANDROID flags
2862}
2863
Jesse Hall715b86a2016-01-16 16:34:29 -08002864@extension("VK_EXT_debug_report")
2865class VkDebugReportCallbackCreateInfoEXT {
2866 VkStructureType sType
2867 const void* pNext
2868 VkDebugReportFlagsEXT flags
2869 PFN_vkDebugReportCallbackEXT pfnCallback
2870 void* pUserData
2871}
2872
Jesse Hall26763382016-05-20 07:13:52 -07002873@extension("VK_AMD_rasterization_order")
2874class VkPipelineRasterizationStateRasterizationOrderAMD {
2875 VkStructureType sType
2876 const void* pNext
2877 VkRasterizationOrderAMD rasterizationOrder
2878}
2879
2880@extension("VK_EXT_debug_marker")
2881class VkDebugMarkerObjectNameInfoEXT {
2882 VkStructureType sType
2883 const void* pNext
2884 VkDebugReportObjectTypeEXT objectType
2885 u64 object
2886 const char* pObjectName
2887}
2888
2889@extension("VK_EXT_debug_marker")
2890class VkDebugMarkerObjectTagInfoEXT {
2891 VkStructureType sType
2892 const void* pNext
2893 VkDebugReportObjectTypeEXT objectType
2894 u64 object
2895 u64 tagName
2896 platform.size_t tagSize
2897 const void* pTag
2898}
2899
2900@extension("VK_EXT_debug_marker")
2901class VkDebugMarkerMarkerInfoEXT {
2902 VkStructureType sType
2903 const void* pNext
2904 const char* pMarkerName
2905 f32[4] color
2906}
2907
Jesse Hall56d386a2016-07-26 15:20:40 -07002908@extension("VK_NV_dedicated_allocation")
2909class VkDedicatedAllocationImageCreateInfoNV {
2910 VkStructureType sType
2911 const void* pNext
2912 VkBool32 dedicatedAllocation
2913}
2914
2915@extension("VK_NV_dedicated_allocation")
2916class VkDedicatedAllocationBufferCreateInfoNV {
2917 VkStructureType sType
2918 const void* pNext
2919 VkBool32 dedicatedAllocation
2920}
2921
2922@extension("VK_NV_dedicated_allocation")
2923class VkDedicatedAllocationMemoryAllocateInfoNV {
2924 VkStructureType sType
2925 const void* pNext
2926 VkImage image
2927 VkBuffer buffer
2928}
2929
Chris Forbes289cb792016-12-30 15:03:55 +13002930@extension("VK_KHR_incremental_present")
2931class VkRectLayerKHR {
2932 VkOffset2D offset
2933 VkExtent2D extent
2934 u32 layer
2935}
2936
2937@extension("VK_KHR_incremental_present")
2938class VkPresentRegionKHR {
2939 u32 rectangleCount
2940 const VkRectLayerKHR* pRectangles
2941}
2942
2943@extension("VK_KHR_incremental_present")
2944class VkPresentRegionsKHR {
2945 VkStructureType sType
2946 const void* pNext
2947 u32 swapchainCount
2948 const VkPresentRegionKHR* pRegions
2949}
2950
2951@extension("VK_NV_external_memory_capabilities")
2952class VkExternalImageFormatPropertiesNV {
2953 VkImageFormatProperties imageFormatProperties
2954 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
2955 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
2956 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
2957}
2958
2959@extension("VK_NV_external_memory")
2960class VkExternalMemoryImageCreateInfoNV {
2961 VkStructureType sType
2962 const void* pNext
2963 VkExternalMemoryHandleTypeFlagsNV handleTypes
2964}
2965
2966@extension("VK_NV_external_memory")
2967class VkExportMemoryAllocateInfoNV {
2968 VkStructureType sType
2969 const void* pNext
2970 VkExternalMemoryHandleTypeFlagsNV handleTypes
2971}
2972
2973@extension("VK_NV_external_memory_win32")
2974class VkImportMemoryWin32HandleInfoNV {
2975 VkStructureType sType
2976 const void* pNext
2977 VkExternalMemoryHandleTypeFlagsNV handleType
2978 platform.HANDLE handle
2979}
2980
2981@extension("VK_NV_external_memory_win32")
2982class VkExportMemoryWin32HandleInfoNV {
2983 VkStructureType sType
2984 const void* pNext
2985 const platform.SECURITY_ATTRIBUTES* pAttributes
2986 u32 dwAccess
2987}
2988
2989@extension("VK_NV_win32_keyed_mutex")
2990class VkWin32KeyedMutexAcquireReleaseInfoNV {
2991 VkStructureType sType
2992 const void* pNext
2993 u32 acquireCount
2994 const VkDeviceMemory* pAcquireSyncs
2995 const u64* pAcquireKeys
2996 const u32* pAcquireTimeoutMilliseconds
2997 u32 releaseCount
2998 const VkDeviceMemory* pReleaseSyncs
2999 const u64* pReleaseKeys
3000}
3001
3002@extension("VK_EXT_validation_flags")
3003class VkValidationFlagsEXT {
3004 VkStructureType sType
3005 const void* pNext
3006 u32 disabledValidationCheckCount
3007 VkValidationCheckEXT* pDisabledValidationChecks
3008}
3009
3010@extension("VK_NVX_device_generated_commands")
3011class VkDeviceGeneratedCommandsFeaturesNVX {
3012 VkStructureType sType
3013 const void* pNext
3014 VkBool32 computeBindingPointSupport
3015}
3016
3017@extension("VK_NVX_device_generated_commands")
3018class VkDeviceGeneratedCommandsLimitsNVX {
3019 VkStructureType sType
3020 const void* pNext
3021 u32 maxIndirectCommandsLayoutTokenCount
3022 u32 maxObjectEntryCounts
3023 u32 minSequenceCountBufferOffsetAlignment
3024 u32 minSequenceIndexBufferOffsetAlignment
3025 u32 minCommandsTokenBufferOffsetAlignment
3026}
3027
3028@extension("VK_NVX_device_generated_commands")
3029class VkIndirectCommandsTokenNVX {
3030 VkIndirectCommandsTokenTypeNVX tokenType
3031 VkBuffer buffer
3032 VkDeviceSize offset
3033}
3034
3035@extension("VK_NVX_device_generated_commands")
3036class VkIndirectCommandsLayoutTokenNVX {
3037 VkIndirectCommandsTokenTypeNVX tokenType
3038 u32 bindingUnit
3039 u32 dynamicCount
3040 u32 divisor
3041}
3042
3043@extension("VK_NVX_device_generated_commands")
3044class VkIndirectCommandsLayoutCreateInfoNVX {
3045 VkStructureType sType
3046 const void* pNext
3047 VkPipelineBindPoint pipelineBindPoint
3048 VkIndirectCommandsLayoutUsageFlagsNVX flags
3049 u32 tokenCount
3050 const VkIndirectCommandsLayoutTokenNVX* pTokens
3051}
3052
3053@extension("VK_NVX_device_generated_commands")
3054class VkCmdProcessCommandsInfoNVX {
3055 VkStructureType sType
3056 const void* pNext
3057 VkObjectTableNVX objectTable
3058 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3059 u32 indirectCommandsTokenCount
3060 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3061 u32 maxSequencesCount
3062 VkCommandBuffer targetCommandBuffer
3063 VkBuffer sequencesCountBuffer
3064 VkDeviceSize sequencesCountOffset
3065 VkBuffer sequencesIndexBuffer
3066 VkDeviceSize sequencesIndexOffset
3067}
3068
3069@extension("VK_NVX_device_generated_commands")
3070class VkCmdReserveSpaceForCommandsInfoNVX {
3071 VkStructureType sType
3072 const void* pNext
3073 VkObjectTableNVX objectTable
3074 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3075 u32 maxSequencesCount
3076}
3077
3078@extension("VK_NVX_device_generated_commands")
3079class VkObjectTableCreateInfoNVX {
3080 VkStructureType sType
3081 const void* pNext
3082 u32 objectCount
3083 const VkObjectEntryTypeNVX* pObjectEntryTypes
3084 const u32* pObjectEntryCounts
3085 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3086 u32 maxUniformBuffersPerDescriptor
3087 u32 maxStorageBuffersPerDescriptor
3088 u32 maxStorageImagesPerDescriptor
3089 u32 maxSampledImagesPerDescriptor
3090 u32 maxPipelineLayouts
3091}
3092
3093@extension("VK_NVX_device_generated_commands")
3094class VkObjectTableEntryNVX {
3095 VkObjectEntryTypeNVX type
3096 VkObjectEntryUsageFlagsNVX flags
3097}
3098
3099@extension("VK_NVX_device_generated_commands")
3100class VkObjectTablePipelineEntryNVX {
3101 VkObjectEntryTypeNVX type
3102 VkObjectEntryUsageFlagsNVX flags
3103 VkPipeline pipeline
3104}
3105
3106@extension("VK_NVX_device_generated_commands")
3107class VkObjectTableDescriptorSetEntryNVX {
3108 VkObjectEntryTypeNVX type
3109 VkObjectEntryUsageFlagsNVX flags
3110 VkPipelineLayout pipelineLayout
3111 VkDescriptorSet descriptorSet
3112}
3113
3114@extension("VK_NVX_device_generated_commands")
3115class VkObjectTableVertexBufferEntryNVX {
3116 VkObjectEntryTypeNVX type
3117 VkObjectEntryUsageFlagsNVX flags
3118 VkBuffer buffer
3119}
3120
3121@extension("VK_NVX_device_generated_commands")
3122class VkObjectTableIndexBufferEntryNVX {
3123 VkObjectEntryTypeNVX type
3124 VkObjectEntryUsageFlagsNVX flags
3125 VkBuffer buffer
3126}
3127
3128@extension("VK_NVX_device_generated_commands")
3129class VkObjectTablePushConstantEntryNVX {
3130 VkObjectEntryTypeNVX type
3131 VkObjectEntryUsageFlagsNVX flags
3132 VkPipelineLayout pipelineLayout
3133 VkShaderStageFlags stageFlags
3134}
3135
3136
Jesse Hall1356b0d2015-11-23 17:24:58 -08003137
Jesse Halld27f6aa2015-08-15 17:58:48 -07003138////////////////
3139// Commands //
3140////////////////
3141
3142// Function pointers. TODO: add support for function pointers.
3143
3144@external type void* PFN_vkVoidFunction
3145@pfn cmd void vkVoidFunction() {
3146}
3147
Jesse Hall3fbc8562015-11-29 22:10:52 -08003148@external type void* PFN_vkAllocationFunction
3149@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003150 void* pUserData,
3151 platform.size_t size,
3152 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003153 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003154 return ?
3155}
3156
Jesse Hall3fbc8562015-11-29 22:10:52 -08003157@external type void* PFN_vkReallocationFunction
3158@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003159 void* pUserData,
3160 void* pOriginal,
3161 platform.size_t size,
3162 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003163 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003164 return ?
3165}
3166
3167@external type void* PFN_vkFreeFunction
3168@pfn cmd void vkFreeFunction(
3169 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003170 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003171}
3172
Jesse Hall3fbc8562015-11-29 22:10:52 -08003173@external type void* PFN_vkInternalAllocationNotification
3174@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003175 void* pUserData,
3176 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003177 VkInternalAllocationType allocationType,
3178 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003179}
3180
3181@external type void* PFN_vkInternalFreeNotification
3182@pfn cmd void vkInternalFreeNotification(
3183 void* pUserData,
3184 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003185 VkInternalAllocationType allocationType,
3186 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003187}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003188
3189// Global functions
3190
3191@threadSafety("system")
3192cmd VkResult vkCreateInstance(
3193 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003194 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003195 VkInstance* pInstance) {
3196 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3197
3198 instance := ?
3199 pInstance[0] = instance
3200 State.Instances[instance] = new!InstanceObject()
3201
Jesse Hall3dd678a2016-01-08 21:52:01 -08003202 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3203 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003204
3205 return ?
3206}
3207
3208@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003209cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003210 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003211 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003212 instanceObject := GetInstance(instance)
3213
3214 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003215}
3216
3217@threadSafety("system")
3218cmd VkResult vkEnumeratePhysicalDevices(
3219 VkInstance instance,
3220 u32* pPhysicalDeviceCount,
3221 VkPhysicalDevice* pPhysicalDevices) {
3222 instanceObject := GetInstance(instance)
3223
3224 physicalDeviceCount := as!u32(?)
3225 pPhysicalDeviceCount[0] = physicalDeviceCount
3226 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3227
3228 for i in (0 .. physicalDeviceCount) {
3229 physicalDevice := ?
3230 physicalDevices[i] = physicalDevice
3231 if !(physicalDevice in State.PhysicalDevices) {
3232 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3233 }
3234 }
3235
3236 return ?
3237}
3238
3239cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3240 VkDevice device,
3241 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003242 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003243 device := GetDevice(device)
3244 }
3245
3246 return ?
3247}
3248
3249cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3250 VkInstance instance,
3251 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003252 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003253 instanceObject := GetInstance(instance)
3254 }
3255
3256 return ?
3257}
3258
Jesse Hall606a54e2015-11-19 22:17:28 -08003259cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003260 VkPhysicalDevice physicalDevice,
3261 VkPhysicalDeviceProperties* pProperties) {
3262 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3263
3264 properties := ?
3265 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003266}
3267
Jesse Hall606a54e2015-11-19 22:17:28 -08003268cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003269 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003270 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003271 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003272 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003273 // TODO: Figure out how to express fetch-count-or-properties
3274 // This version fails 'apic validate' with 'fence not allowed in
3275 // *semantic.Branch'. Other attempts have failed with the same or other
3276 // errors.
3277 // if pQueueFamilyProperties != null {
3278 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3279 // for i in (0 .. pCount[0]) {
3280 // queueProperties := as!VkQueueFamilyProperties(?)
3281 // queuesProperties[i] = queueProperties
3282 // }
3283 // } else {
3284 // count := ?
3285 // pCount[0] = count
3286 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003287}
3288
Jesse Hall606a54e2015-11-19 22:17:28 -08003289cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003290 VkPhysicalDevice physicalDevice,
3291 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3292 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3293
3294 memoryProperties := ?
3295 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003296}
3297
Jesse Hall606a54e2015-11-19 22:17:28 -08003298cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003299 VkPhysicalDevice physicalDevice,
3300 VkPhysicalDeviceFeatures* pFeatures) {
3301 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3302
3303 features := ?
3304 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003305}
3306
Jesse Hall606a54e2015-11-19 22:17:28 -08003307cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003308 VkPhysicalDevice physicalDevice,
3309 VkFormat format,
3310 VkFormatProperties* pFormatProperties) {
3311 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3312
3313 formatProperties := ?
3314 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003315}
3316
Jesse Halla9e57032015-11-30 01:03:10 -08003317cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003318 VkPhysicalDevice physicalDevice,
3319 VkFormat format,
3320 VkImageType type,
3321 VkImageTiling tiling,
3322 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003323 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003324 VkImageFormatProperties* pImageFormatProperties) {
3325 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3326
3327 imageFormatProperties := ?
3328 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003329
3330 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003331}
3332
Jesse Halld27f6aa2015-08-15 17:58:48 -07003333
3334// Device functions
3335
3336@threadSafety("system")
3337cmd VkResult vkCreateDevice(
3338 VkPhysicalDevice physicalDevice,
3339 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003340 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003341 VkDevice* pDevice) {
3342 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3343 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3344
3345 device := ?
3346 pDevice[0] = device
3347 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3348
3349 return ?
3350}
3351
3352@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003353cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003354 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003355 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003356 deviceObject := GetDevice(device)
3357
3358 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003359}
3360
3361
3362// Extension discovery functions
3363
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003364cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003365 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003366 VkLayerProperties* pProperties) {
3367 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003368 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003369
3370 properties := pProperties[0:count]
3371 for i in (0 .. count) {
3372 property := ?
3373 properties[i] = property
3374 }
3375
3376 return ?
3377}
3378
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003379cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003380 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003381 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003382 VkExtensionProperties* pProperties) {
3383 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003384 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003385
3386 properties := pProperties[0:count]
3387 for i in (0 .. count) {
3388 property := ?
3389 properties[i] = property
3390 }
3391
3392 return ?
3393}
3394
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003395cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003396 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003397 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003398 VkLayerProperties* pProperties) {
3399 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3400 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003401 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003402
3403 properties := pProperties[0:count]
3404 for i in (0 .. count) {
3405 property := ?
3406 properties[i] = property
3407 }
3408
3409 return ?
3410}
3411
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003412cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003413 VkPhysicalDevice physicalDevice,
3414 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003415 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003416 VkExtensionProperties* pProperties) {
3417 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3418
3419 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003420 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003421
3422 properties := pProperties[0:count]
3423 for i in (0 .. count) {
3424 property := ?
3425 properties[i] = property
3426 }
3427
3428 return ?
3429}
3430
3431
3432// Queue functions
3433
3434@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003435cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003436 VkDevice device,
3437 u32 queueFamilyIndex,
3438 u32 queueIndex,
3439 VkQueue* pQueue) {
3440 deviceObject := GetDevice(device)
3441
3442 queue := ?
3443 pQueue[0] = queue
3444
3445 if !(queue in State.Queues) {
3446 State.Queues[queue] = new!QueueObject(device: device)
3447 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003448}
3449
3450@threadSafety("app")
3451cmd VkResult vkQueueSubmit(
3452 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003453 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003454 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003455 VkFence fence) {
3456 queueObject := GetQueue(queue)
3457
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003458 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003459 fenceObject := GetFence(fence)
3460 assert(fenceObject.device == queueObject.device)
3461 }
3462
Jesse Hall3fbc8562015-11-29 22:10:52 -08003463 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3464 // for i in (0 .. commandBufferCount) {
3465 // commandBuffer := commandBuffers[i]
3466 // commandBufferObject := GetCommandBuffer(commandBuffer)
3467 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003468 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003469 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3470 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003471 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003472
3473 return ?
3474}
3475
3476@threadSafety("system")
3477cmd VkResult vkQueueWaitIdle(
3478 VkQueue queue) {
3479 queueObject := GetQueue(queue)
3480
3481 return ?
3482}
3483
3484@threadSafety("system")
3485cmd VkResult vkDeviceWaitIdle(
3486 VkDevice device) {
3487 deviceObject := GetDevice(device)
3488
3489 return ?
3490}
3491
3492
3493// Memory functions
3494
3495@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003496cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003497 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003498 const VkMemoryAllocateInfo* pAllocateInfo,
3499 const VkAllocationCallbacks* pAllocator,
3500 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003501 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003502 deviceObject := GetDevice(device)
3503
Jesse Hall3fbc8562015-11-29 22:10:52 -08003504 memory := ?
3505 pMemory[0] = memory
3506 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003507 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003508 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003509
3510 return ?
3511}
3512
3513@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003514cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003515 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003516 VkDeviceMemory memory,
3517 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003518 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003519 memoryObject := GetDeviceMemory(memory)
3520 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003521
3522 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003523 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003524 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003525 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3526 "vkFreeMemory: commandBuffers still bound")
3527 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003528}
3529
3530@threadSafety("app")
3531cmd VkResult vkMapMemory(
3532 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003533 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003534 VkDeviceSize offset,
3535 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003536 VkMemoryMapFlags flags,
3537 void** ppData) {
3538 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003539 memoryObject := GetDeviceMemory(memory)
3540 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003541
3542 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003543 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003544
3545 return ?
3546}
3547
3548@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003549cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003550 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003551 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003552 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003553 memoryObject := GetDeviceMemory(memory)
3554 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003555}
3556
3557cmd VkResult vkFlushMappedMemoryRanges(
3558 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003559 u32 memoryRangeCount
3560 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003561 deviceObject := GetDevice(device)
3562
Jesse Hall3fbc8562015-11-29 22:10:52 -08003563 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3564 for i in (0 .. memoryRangeCount) {
3565 memoryRange := memoryRanges[i]
3566 memoryObject := GetDeviceMemory(memoryRange.memory)
3567 assert(memoryObject.device == device)
3568 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003569 }
3570
3571 return ?
3572}
3573
3574cmd VkResult vkInvalidateMappedMemoryRanges(
3575 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003576 u32 memoryRangeCount,
3577 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003578 deviceObject := GetDevice(device)
3579
Jesse Hall3fbc8562015-11-29 22:10:52 -08003580 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3581 for i in (0 .. memoryRangeCount) {
3582 memoryRange := memoryRanges[i]
3583 memoryObject := GetDeviceMemory(memoryRange.memory)
3584 assert(memoryObject.device == device)
3585 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003586 }
3587
3588 return ?
3589}
3590
3591
3592// Memory management API functions
3593
Jesse Hall606a54e2015-11-19 22:17:28 -08003594cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003595 VkDevice device,
3596 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003597 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003598 deviceObject := GetDevice(device)
3599
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003600 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003601 memoryObject := GetDeviceMemory(memory)
3602 assert(memoryObject.device == device)
3603 }
3604
3605 committedMemoryInBytes := ?
3606 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003607}
3608
Jesse Hall606a54e2015-11-19 22:17:28 -08003609cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003610 VkDevice device,
3611 VkBuffer buffer,
3612 VkMemoryRequirements* pMemoryRequirements) {
3613 deviceObject := GetDevice(device)
3614 bufferObject := GetBuffer(buffer)
3615 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003616}
3617
3618cmd VkResult vkBindBufferMemory(
3619 VkDevice device,
3620 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003621 VkDeviceMemory memory,
3622 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003623 deviceObject := GetDevice(device)
3624 bufferObject := GetBuffer(buffer)
3625 assert(bufferObject.device == device)
3626
3627 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003628 if bufferObject.memory != NULL_HANDLE {
3629 memoryObject := GetDeviceMemory(bufferObject.memory)
3630 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003631 }
3632
3633 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003634 if memory != NULL_HANDLE {
3635 memoryObject := GetDeviceMemory(memory)
3636 assert(memoryObject.device == device)
3637 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003638 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003639 bufferObject.memory = memory
3640 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003641
3642 return ?
3643}
3644
Jesse Hall606a54e2015-11-19 22:17:28 -08003645cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003646 VkDevice device,
3647 VkImage image,
3648 VkMemoryRequirements* pMemoryRequirements) {
3649 deviceObject := GetDevice(device)
3650 imageObject := GetImage(image)
3651 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003652}
3653
3654cmd VkResult vkBindImageMemory(
3655 VkDevice device,
3656 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003657 VkDeviceMemory memory,
3658 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003659 deviceObject := GetDevice(device)
3660 imageObject := GetImage(image)
3661 assert(imageObject.device == device)
3662
3663 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003664 if imageObject.memory != NULL_HANDLE {
3665 memoryObject := GetDeviceMemory(imageObject.memory)
3666 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003667 }
3668
3669 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003670 if memory != NULL_HANDLE {
3671 memoryObject := GetDeviceMemory(memory)
3672 assert(memoryObject.device == device)
3673 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003674 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003675 imageObject.memory = memory
3676 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003677
3678 return ?
3679}
3680
Jesse Hall606a54e2015-11-19 22:17:28 -08003681cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003682 VkDevice device,
3683 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003684 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003685 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3686 deviceObject := GetDevice(device)
3687 imageObject := GetImage(image)
3688 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003689}
3690
Jesse Hall606a54e2015-11-19 22:17:28 -08003691cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003692 VkPhysicalDevice physicalDevice,
3693 VkFormat format,
3694 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003695 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003696 VkImageUsageFlags usage,
3697 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003698 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003699 VkSparseImageFormatProperties* pProperties) {
3700 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003701}
3702
Jesse Halla6429252015-11-29 18:59:42 -08003703cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003704 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003705 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003706 const VkBindSparseInfo* pBindInfo,
3707 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003708 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003709
3710 return ?
3711}
3712
3713
3714// Fence functions
3715
3716@threadSafety("system")
3717cmd VkResult vkCreateFence(
3718 VkDevice device,
3719 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003720 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003721 VkFence* pFence) {
3722 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3723 deviceObject := GetDevice(device)
3724
3725 fence := ?
3726 pFence[0] = fence
3727 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003728 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003729
3730 return ?
3731}
3732
3733@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003734cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003735 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003736 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003737 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003738 deviceObject := GetDevice(device)
3739 fenceObject := GetFence(fence)
3740 assert(fenceObject.device == device)
3741
3742 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003743}
3744
3745@threadSafety("system")
3746cmd VkResult vkResetFences(
3747 VkDevice device,
3748 u32 fenceCount,
3749 const VkFence* pFences) {
3750 deviceObject := GetDevice(device)
3751
3752 fences := pFences[0:fenceCount]
3753 for i in (0 .. fenceCount) {
3754 fence := fences[i]
3755 fenceObject := GetFence(fence)
3756 assert(fenceObject.device == device)
3757 fenceObject.signaled = false
3758 }
3759
3760 return ?
3761}
3762
3763@threadSafety("system")
3764cmd VkResult vkGetFenceStatus(
3765 VkDevice device,
3766 VkFence fence) {
3767 deviceObject := GetDevice(device)
3768 fenceObject := GetFence(fence)
3769 assert(fenceObject.device == device)
3770
3771 return ?
3772}
3773
3774@threadSafety("system")
3775cmd VkResult vkWaitForFences(
3776 VkDevice device,
3777 u32 fenceCount,
3778 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003779 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780 u64 timeout) { /// timeout in nanoseconds
3781 deviceObject := GetDevice(device)
3782
3783 fences := pFences[0:fenceCount]
3784 for i in (0 .. fenceCount) {
3785 fence := fences[i]
3786 fenceObject := GetFence(fence)
3787 assert(fenceObject.device == device)
3788 }
3789
3790 return ?
3791}
3792
3793
3794// Queue semaphore functions
3795
3796@threadSafety("system")
3797cmd VkResult vkCreateSemaphore(
3798 VkDevice device,
3799 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003800 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003801 VkSemaphore* pSemaphore) {
3802 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3803 deviceObject := GetDevice(device)
3804
3805 semaphore := ?
3806 pSemaphore[0] = semaphore
3807 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3808
3809 return ?
3810}
3811
3812@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003813cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003814 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003815 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003816 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003817 deviceObject := GetDevice(device)
3818 semaphoreObject := GetSemaphore(semaphore)
3819 assert(semaphoreObject.device == device)
3820
3821 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003822}
3823
Jesse Halld27f6aa2015-08-15 17:58:48 -07003824
3825// Event functions
3826
3827@threadSafety("system")
3828cmd VkResult vkCreateEvent(
3829 VkDevice device,
3830 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003831 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003832 VkEvent* pEvent) {
3833 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3834 deviceObject := GetDevice(device)
3835
3836 event := ?
3837 pEvent[0] = event
3838 State.Events[event] = new!EventObject(device: device)
3839
3840 return ?
3841}
3842
3843@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003844cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003845 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003846 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003847 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003848 deviceObject := GetDevice(device)
3849 eventObject := GetEvent(event)
3850 assert(eventObject.device == device)
3851
3852 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003853}
3854
3855@threadSafety("system")
3856cmd VkResult vkGetEventStatus(
3857 VkDevice device,
3858 VkEvent event) {
3859 deviceObject := GetDevice(device)
3860 eventObject := GetEvent(event)
3861 assert(eventObject.device == device)
3862
3863 return ?
3864}
3865
3866@threadSafety("system")
3867cmd VkResult vkSetEvent(
3868 VkDevice device,
3869 VkEvent event) {
3870 deviceObject := GetDevice(device)
3871 eventObject := GetEvent(event)
3872 assert(eventObject.device == device)
3873
3874 return ?
3875}
3876
3877@threadSafety("system")
3878cmd VkResult vkResetEvent(
3879 VkDevice device,
3880 VkEvent event) {
3881 deviceObject := GetDevice(device)
3882 eventObject := GetEvent(event)
3883 assert(eventObject.device == device)
3884
3885 return ?
3886}
3887
3888
3889// Query functions
3890
3891@threadSafety("system")
3892cmd VkResult vkCreateQueryPool(
3893 VkDevice device,
3894 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003895 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003896 VkQueryPool* pQueryPool) {
3897 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3898 deviceObject := GetDevice(device)
3899
3900 queryPool := ?
3901 pQueryPool[0] = queryPool
3902 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3903
3904 return ?
3905}
3906
3907@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003908cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003909 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003910 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003911 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003912 deviceObject := GetDevice(device)
3913 queryPoolObject := GetQueryPool(queryPool)
3914 assert(queryPoolObject.device == device)
3915
3916 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003917}
3918
3919@threadSafety("system")
3920cmd VkResult vkGetQueryPoolResults(
3921 VkDevice device,
3922 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003923 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003924 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003925 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003926 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003927 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003928 VkQueryResultFlags flags) {
3929 deviceObject := GetDevice(device)
3930 queryPoolObject := GetQueryPool(queryPool)
3931 assert(queryPoolObject.device == device)
3932
Jesse Halld27f6aa2015-08-15 17:58:48 -07003933 data := pData[0:dataSize]
3934
3935 return ?
3936}
3937
3938// Buffer functions
3939
3940@threadSafety("system")
3941cmd VkResult vkCreateBuffer(
3942 VkDevice device,
3943 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003944 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003945 VkBuffer* pBuffer) {
3946 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3947 deviceObject := GetDevice(device)
3948
3949 buffer := ?
3950 pBuffer[0] = buffer
3951 State.Buffers[buffer] = new!BufferObject(device: device)
3952
3953 return ?
3954}
3955
3956@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003957cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003958 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003959 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003960 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003961 deviceObject := GetDevice(device)
3962 bufferObject := GetBuffer(buffer)
3963 assert(bufferObject.device == device)
3964
Jesse Hall3fbc8562015-11-29 22:10:52 -08003965 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003966 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003967}
3968
3969
3970// Buffer view functions
3971
3972@threadSafety("system")
3973cmd VkResult vkCreateBufferView(
3974 VkDevice device,
3975 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003976 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003977 VkBufferView* pView) {
3978 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3979 deviceObject := GetDevice(device)
3980
3981 bufferObject := GetBuffer(pCreateInfo.buffer)
3982 assert(bufferObject.device == device)
3983
3984 view := ?
3985 pView[0] = view
3986 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3987
3988 return ?
3989}
3990
3991@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003992cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003993 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003994 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003995 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003996 deviceObject := GetDevice(device)
3997 bufferViewObject := GetBufferView(bufferView)
3998 assert(bufferViewObject.device == device)
3999
4000 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004001}
4002
4003
4004// Image functions
4005
4006@threadSafety("system")
4007cmd VkResult vkCreateImage(
4008 VkDevice device,
4009 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004010 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004011 VkImage* pImage) {
4012 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4013 deviceObject := GetDevice(device)
4014
4015 image := ?
4016 pImage[0] = image
4017 State.Images[image] = new!ImageObject(device: device)
4018
4019 return ?
4020}
4021
4022@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004023cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004024 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004025 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004026 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004027 deviceObject := GetDevice(device)
4028 imageObject := GetImage(image)
4029 assert(imageObject.device == device)
4030
Jesse Hall3fbc8562015-11-29 22:10:52 -08004031 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004032 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004033}
4034
Jesse Hall606a54e2015-11-19 22:17:28 -08004035cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004036 VkDevice device,
4037 VkImage image,
4038 const VkImageSubresource* pSubresource,
4039 VkSubresourceLayout* pLayout) {
4040 deviceObject := GetDevice(device)
4041 imageObject := GetImage(image)
4042 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004043}
4044
4045
4046// Image view functions
4047
4048@threadSafety("system")
4049cmd VkResult vkCreateImageView(
4050 VkDevice device,
4051 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004052 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004053 VkImageView* pView) {
4054 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4055 deviceObject := GetDevice(device)
4056
4057 imageObject := GetImage(pCreateInfo.image)
4058 assert(imageObject.device == device)
4059
4060 view := ?
4061 pView[0] = view
4062 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4063
4064 return ?
4065}
4066
4067@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004068cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004069 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004070 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004071 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004072 deviceObject := GetDevice(device)
4073 imageViewObject := GetImageView(imageView)
4074 assert(imageViewObject.device == device)
4075
4076 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004077}
4078
4079
4080// Shader functions
4081
4082cmd VkResult vkCreateShaderModule(
4083 VkDevice device,
4084 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004085 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004086 VkShaderModule* pShaderModule) {
4087 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4088 deviceObject := GetDevice(device)
4089
4090 shaderModule := ?
4091 pShaderModule[0] = shaderModule
4092 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4093
4094 return ?
4095}
4096
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004097cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004098 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004099 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004100 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004101 deviceObject := GetDevice(device)
4102 shaderModuleObject := GetShaderModule(shaderModule)
4103 assert(shaderModuleObject.device == device)
4104
4105 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004106}
4107
Jesse Halld27f6aa2015-08-15 17:58:48 -07004108
4109// Pipeline functions
4110
4111cmd VkResult vkCreatePipelineCache(
4112 VkDevice device,
4113 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004114 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004115 VkPipelineCache* pPipelineCache) {
4116 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4117 deviceObject := GetDevice(device)
4118
4119 pipelineCache := ?
4120 pPipelineCache[0] = pipelineCache
4121 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4122
4123 return ?
4124}
4125
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004126cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004127 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004128 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004129 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004130 deviceObject := GetDevice(device)
4131 pipelineCacheObject := GetPipelineCache(pipelineCache)
4132 assert(pipelineCacheObject.device == device)
4133
4134 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004135}
4136
Jesse Halld27f6aa2015-08-15 17:58:48 -07004137cmd VkResult vkGetPipelineCacheData(
4138 VkDevice device,
4139 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004140 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004141 void* pData) {
4142 deviceObject := GetDevice(device)
4143 pipelineCacheObject := GetPipelineCache(pipelineCache)
4144 assert(pipelineCacheObject.device == device)
4145
4146 return ?
4147}
4148
4149cmd VkResult vkMergePipelineCaches(
4150 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004151 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004152 u32 srcCacheCount,
4153 const VkPipelineCache* pSrcCaches) {
4154 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004155 dstCacheObject := GetPipelineCache(dstCache)
4156 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004157
4158 srcCaches := pSrcCaches[0:srcCacheCount]
4159 for i in (0 .. srcCacheCount) {
4160 srcCache := srcCaches[i]
4161 srcCacheObject := GetPipelineCache(srcCache)
4162 assert(srcCacheObject.device == device)
4163 }
4164
4165 return ?
4166}
4167
4168cmd VkResult vkCreateGraphicsPipelines(
4169 VkDevice device,
4170 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004171 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004172 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004173 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004174 VkPipeline* pPipelines) {
4175 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004176 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004177 pipelineCacheObject := GetPipelineCache(pipelineCache)
4178 assert(pipelineCacheObject.device == device)
4179 }
4180
Jesse Hall03b6fe12015-11-24 12:44:21 -08004181 createInfos := pCreateInfos[0:createInfoCount]
4182 pipelines := pPipelines[0:createInfoCount]
4183 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004184 pipeline := ?
4185 pipelines[i] = pipeline
4186 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4187 }
4188
4189 return ?
4190}
4191
4192cmd VkResult vkCreateComputePipelines(
4193 VkDevice device,
4194 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004195 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004196 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004197 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004198 VkPipeline* pPipelines) {
4199 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004200 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004201 pipelineCacheObject := GetPipelineCache(pipelineCache)
4202 assert(pipelineCacheObject.device == device)
4203 }
4204
Jesse Hall03b6fe12015-11-24 12:44:21 -08004205 createInfos := pCreateInfos[0:createInfoCount]
4206 pipelines := pPipelines[0:createInfoCount]
4207 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004208 pipeline := ?
4209 pipelines[i] = pipeline
4210 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4211 }
4212
4213 return ?
4214}
4215
4216@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004217cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004218 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004219 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004220 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004221 deviceObject := GetDevice(device)
4222 pipelineObjects := GetPipeline(pipeline)
4223 assert(pipelineObjects.device == device)
4224
4225 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004226}
4227
4228
4229// Pipeline layout functions
4230
4231@threadSafety("system")
4232cmd VkResult vkCreatePipelineLayout(
4233 VkDevice device,
4234 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004235 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004236 VkPipelineLayout* pPipelineLayout) {
4237 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4238 deviceObject := GetDevice(device)
4239
4240 pipelineLayout := ?
4241 pPipelineLayout[0] = pipelineLayout
4242 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4243
4244 return ?
4245}
4246
4247@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004248cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004249 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004250 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004251 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004252 deviceObject := GetDevice(device)
4253 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4254 assert(pipelineLayoutObjects.device == device)
4255
4256 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004257}
4258
4259
4260// Sampler functions
4261
4262@threadSafety("system")
4263cmd VkResult vkCreateSampler(
4264 VkDevice device,
4265 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004266 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004267 VkSampler* pSampler) {
4268 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4269 deviceObject := GetDevice(device)
4270
4271 sampler := ?
4272 pSampler[0] = sampler
4273 State.Samplers[sampler] = new!SamplerObject(device: device)
4274
4275 return ?
4276}
4277
4278@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004279cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004280 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004281 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004282 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004283 deviceObject := GetDevice(device)
4284 samplerObject := GetSampler(sampler)
4285 assert(samplerObject.device == device)
4286
4287 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004288}
4289
4290
4291// Descriptor set functions
4292
4293@threadSafety("system")
4294cmd VkResult vkCreateDescriptorSetLayout(
4295 VkDevice device,
4296 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004297 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004298 VkDescriptorSetLayout* pSetLayout) {
4299 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4300 deviceObject := GetDevice(device)
4301
4302 setLayout := ?
4303 pSetLayout[0] = setLayout
4304 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4305
4306 return ?
4307}
4308
4309@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004310cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004311 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004312 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004313 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004314 deviceObject := GetDevice(device)
4315 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4316 assert(descriptorSetLayoutObject.device == device)
4317
4318 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004319}
4320
4321@threadSafety("system")
4322cmd VkResult vkCreateDescriptorPool(
4323 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004324 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004325 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004326 VkDescriptorPool* pDescriptorPool) {
4327 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4328 deviceObject := GetDevice(device)
4329
4330 descriptorPool := ?
4331 pDescriptorPool[0] = descriptorPool
4332 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4333
4334 return ?
4335}
4336
4337@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004338cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004339 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004340 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004341 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004342 deviceObject := GetDevice(device)
4343 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4344 assert(descriptorPoolObject.device == device)
4345
4346 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004347}
4348
4349@threadSafety("app")
4350cmd VkResult vkResetDescriptorPool(
4351 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004352 VkDescriptorPool descriptorPool,
4353 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004354 deviceObject := GetDevice(device)
4355 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4356 assert(descriptorPoolObject.device == device)
4357
4358 return ?
4359}
4360
4361@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004362cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004363 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004364 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004365 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004366 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004367 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004368 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004369
Jesse Hall03b6fe12015-11-24 12:44:21 -08004370 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4371 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004372 setLayout := setLayouts[i]
4373 setLayoutObject := GetDescriptorSetLayout(setLayout)
4374 assert(setLayoutObject.device == device)
4375 }
4376
Jesse Hall03b6fe12015-11-24 12:44:21 -08004377 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4378 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004379 descriptorSet := ?
4380 descriptorSets[i] = descriptorSet
4381 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4382 }
4383
4384 return ?
4385}
4386
Jesse Hallf09c6b12015-08-15 19:54:28 -07004387cmd VkResult vkFreeDescriptorSets(
4388 VkDevice device,
4389 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004390 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004391 const VkDescriptorSet* pDescriptorSets) {
4392 deviceObject := GetDevice(device)
4393 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4394
Jesse Hall03b6fe12015-11-24 12:44:21 -08004395 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4396 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004397 descriptorSet := descriptorSets[i]
4398 descriptorSetObject := GetDescriptorSet(descriptorSet)
4399 assert(descriptorSetObject.device == device)
4400 State.DescriptorSets[descriptorSet] = null
4401 }
4402
4403 return ?
4404}
4405
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004406cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004407 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004408 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004409 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004410 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004411 const VkCopyDescriptorSet* pDescriptorCopies) {
4412 deviceObject := GetDevice(device)
4413
Jesse Hallb00daad2015-11-29 19:46:20 -08004414 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4415 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004416 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004417 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004418 assert(descriptorWriteObject.device == device)
4419 }
4420
Jesse Hallb00daad2015-11-29 19:46:20 -08004421 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4422 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004423 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004424 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004425 assert(descriptorCopyObject.device == device)
4426 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004427}
4428
4429
4430// Framebuffer functions
4431
4432@threadSafety("system")
4433cmd VkResult vkCreateFramebuffer(
4434 VkDevice device,
4435 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004436 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004437 VkFramebuffer* pFramebuffer) {
4438 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4439 deviceObject := GetDevice(device)
4440
4441 framebuffer := ?
4442 pFramebuffer[0] = framebuffer
4443 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4444
4445 return ?
4446}
4447
4448@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004449cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004450 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004451 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004452 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004453 deviceObject := GetDevice(device)
4454 framebufferObject := GetFramebuffer(framebuffer)
4455 assert(framebufferObject.device == device)
4456
4457 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004458}
4459
4460
4461// Renderpass functions
4462
4463@threadSafety("system")
4464cmd VkResult vkCreateRenderPass(
4465 VkDevice device,
4466 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004467 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004468 VkRenderPass* pRenderPass) {
4469 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4470 deviceObject := GetDevice(device)
4471
4472 renderpass := ?
4473 pRenderPass[0] = renderpass
4474 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4475
4476 return ?
4477}
4478
4479@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004480cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004481 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004482 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004483 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004484 deviceObject := GetDevice(device)
4485 renderPassObject := GetRenderPass(renderPass)
4486 assert(renderPassObject.device == device)
4487
4488 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004489}
4490
Jesse Hall606a54e2015-11-19 22:17:28 -08004491cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004492 VkDevice device,
4493 VkRenderPass renderPass,
4494 VkExtent2D* pGranularity) {
4495 deviceObject := GetDevice(device)
4496 renderPassObject := GetRenderPass(renderPass)
4497
4498 granularity := ?
4499 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004500}
4501
4502// Command pool functions
4503
4504cmd VkResult vkCreateCommandPool(
4505 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004506 const VkCommandPoolCreateInfo* pCreateInfo,
4507 const VkAllocationCallbacks* pAllocator,
4508 VkCommandPool* pCommandPool) {
4509 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004510 deviceObject := GetDevice(device)
4511
Jesse Hall3fbc8562015-11-29 22:10:52 -08004512 commandPool := ?
4513 pCommandPool[0] = commandPool
4514 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004515
4516 return ?
4517}
4518
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004519cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004520 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004521 VkCommandPool commandPool,
4522 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004523 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004524 commandPoolObject := GetCommandPool(commandPool)
4525 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004526
Jesse Hall3fbc8562015-11-29 22:10:52 -08004527 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004528}
4529
4530cmd VkResult vkResetCommandPool(
4531 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004532 VkCommandPool commandPool,
4533 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004534 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004535 commandPoolObject := GetCommandPool(commandPool)
4536 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004537
4538 return ?
4539}
4540
4541// Command buffer functions
4542
Jesse Hall3fbc8562015-11-29 22:10:52 -08004543macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4544 memoryObject := GetDeviceMemory(memory)
4545 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004546
Jesse Hall3fbc8562015-11-29 22:10:52 -08004547 commandBufferObject := GetCommandBuffer(commandBuffer)
4548 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004549}
4550
Jesse Hall3fbc8562015-11-29 22:10:52 -08004551macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4552 memoryObject := GetDeviceMemory(memory)
4553 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004554
Jesse Hall3fbc8562015-11-29 22:10:52 -08004555 commandBufferObject := GetCommandBuffer(commandBuffer)
4556 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004557}
4558
4559@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004560cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004561 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004562 const VkCommandBufferAllocateInfo* pAllocateInfo,
4563 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004564 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004565
Jesse Hall3dd678a2016-01-08 21:52:01 -08004566 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004567 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004568 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004569 commandBuffer := ?
4570 commandBuffers[i] = commandBuffer
4571 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004572 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004573
4574 return ?
4575}
4576
4577@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004578cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004579 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004580 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004581 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004582 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004583 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004584
Jesse Hall3fbc8562015-11-29 22:10:52 -08004585 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004586 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004587 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4588 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004589 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004590 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004591 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004592}
4593
4594@threadSafety("app")
4595cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004596 VkCommandBuffer commandBuffer,
4597 const VkCommandBufferBeginInfo* pBeginInfo) {
4598 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4599 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004600
4601 // TODO: iterate over boundObjects and clear memory bindings
4602
4603 return ?
4604}
4605
4606@threadSafety("app")
4607cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004608 VkCommandBuffer commandBuffer) {
4609 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004610
4611 return ?
4612}
4613
4614@threadSafety("app")
4615cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004616 VkCommandBuffer commandBuffer,
4617 VkCommandBufferResetFlags flags) {
4618 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004619
4620 // TODO: iterate over boundObjects and clear memory bindings
4621
4622 return ?
4623}
4624
4625
4626// Command buffer building functions
4627
4628@threadSafety("app")
4629cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004630 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004631 VkPipelineBindPoint pipelineBindPoint,
4632 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004633 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004634 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004635 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004636
Jesse Halld8bade02015-11-24 10:24:18 -08004637 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004638 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4639 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4640 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004641 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004642}
4643
4644@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004645cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004646 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004647 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004648 u32 viewportCount,
4649 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004650 commandBufferObject := GetCommandBuffer(commandBuffer)
4651 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004652}
4653
4654@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004655cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004656 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004657 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004658 u32 scissorCount,
4659 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004660 commandBufferObject := GetCommandBuffer(commandBuffer)
4661 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004662}
4663
4664@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004665cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004666 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004667 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004668 commandBufferObject := GetCommandBuffer(commandBuffer)
4669 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004670}
4671
4672@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004673cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004674 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004675 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004676 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004677 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004678 commandBufferObject := GetCommandBuffer(commandBuffer)
4679 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004680}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004681
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004682@threadSafety("app")
4683cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004684 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004685 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4686 // an annotation as a quick hack to pass this to the template without
4687 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004688 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004689 commandBufferObject := GetCommandBuffer(commandBuffer)
4690 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004691}
4692
4693@threadSafety("app")
4694cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004695 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004696 f32 minDepthBounds,
4697 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004698 commandBufferObject := GetCommandBuffer(commandBuffer)
4699 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004700}
4701
4702@threadSafety("app")
4703cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004704 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004705 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004706 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004707 commandBufferObject := GetCommandBuffer(commandBuffer)
4708 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004709}
4710
4711@threadSafety("app")
4712cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004713 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004714 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004715 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004716 commandBufferObject := GetCommandBuffer(commandBuffer)
4717 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004718}
4719
4720@threadSafety("app")
4721cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004722 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004723 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004724 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004725 commandBufferObject := GetCommandBuffer(commandBuffer)
4726 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004727}
4728
4729@threadSafety("app")
4730cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004731 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004732 VkPipelineBindPoint pipelineBindPoint,
4733 VkPipelineLayout layout,
4734 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004735 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004736 const VkDescriptorSet* pDescriptorSets,
4737 u32 dynamicOffsetCount,
4738 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004739 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004740
Jesse Hall03b6fe12015-11-24 12:44:21 -08004741 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4742 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004743 descriptorSet := descriptorSets[i]
4744 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004745 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004746 }
4747
4748 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4749 for i in (0 .. dynamicOffsetCount) {
4750 dynamicOffset := dynamicOffsets[i]
4751 }
4752
Jesse Halld8bade02015-11-24 10:24:18 -08004753 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004754 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4755 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4756 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004757 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004758}
4759
4760@threadSafety("app")
4761cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004762 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004763 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004764 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004765 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004766 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004767 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004768 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004769
Jesse Hall3fbc8562015-11-29 22:10:52 -08004770 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004771
Jesse Hall3fbc8562015-11-29 22:10:52 -08004772 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004773}
4774
4775@threadSafety("app")
4776cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004777 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004778 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004779 u32 bindingCount,
4780 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004781 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004782 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004783
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004784 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004785 buffers := pBuffers[0:bindingCount]
4786 offsets := pOffsets[0:bindingCount]
4787 for i in (0 .. bindingCount) {
4788 buffer := buffers[i]
4789 offset := offsets[i]
4790 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004791 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004792
Jesse Hall3fbc8562015-11-29 22:10:52 -08004793 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004794 }
4795
Jesse Hall3fbc8562015-11-29 22:10:52 -08004796 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004797}
4798
4799@threadSafety("app")
4800cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004801 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004802 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004803 u32 instanceCount,
4804 u32 firstVertex,
4805 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004806 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004807
Jesse Hall3fbc8562015-11-29 22:10:52 -08004808 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004809}
4810
4811@threadSafety("app")
4812cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004813 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004814 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004815 u32 instanceCount,
4816 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004817 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004818 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004819 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004820
Jesse Hall3fbc8562015-11-29 22:10:52 -08004821 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004822}
4823
4824@threadSafety("app")
4825cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004826 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004827 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004828 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004829 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004830 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004831 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004832 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004833 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004834
Jesse Hall3fbc8562015-11-29 22:10:52 -08004835 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004836
Jesse Hall3fbc8562015-11-29 22:10:52 -08004837 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004838}
4839
4840@threadSafety("app")
4841cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004842 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004843 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004844 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004845 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004846 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004847 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004848 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004849 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004850
Jesse Hall3fbc8562015-11-29 22:10:52 -08004851 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004852
Jesse Hall3fbc8562015-11-29 22:10:52 -08004853 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004854}
4855
4856@threadSafety("app")
4857cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004858 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004859 u32 x,
4860 u32 y,
4861 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004862 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004863
Jesse Hall3fbc8562015-11-29 22:10:52 -08004864 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004865}
4866
4867@threadSafety("app")
4868cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004869 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004870 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004871 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004872 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004873 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004874 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004875
Jesse Hall3fbc8562015-11-29 22:10:52 -08004876 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004877
Jesse Hall3fbc8562015-11-29 22:10:52 -08004878 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004879}
4880
4881@threadSafety("app")
4882cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004883 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004884 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004885 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004886 u32 regionCount,
4887 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004888 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004889 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004890 dstBufferObject := GetBuffer(dstBuffer)
4891 assert(commandBufferObject.device == srcBufferObject.device)
4892 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004893
4894 regions := pRegions[0:regionCount]
4895 for i in (0 .. regionCount) {
4896 region := regions[i]
4897 }
4898
Jesse Hall3fbc8562015-11-29 22:10:52 -08004899 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4900 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004901
Jesse Hall65ab5522015-11-30 00:07:16 -08004902 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004903}
4904
4905@threadSafety("app")
4906cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004907 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004908 VkImage srcImage,
4909 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004910 VkImage dstImage,
4911 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004912 u32 regionCount,
4913 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004914 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004915 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004916 dstImageObject := GetImage(dstImage)
4917 assert(commandBufferObject.device == srcImageObject.device)
4918 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004919
4920 regions := pRegions[0:regionCount]
4921 for i in (0 .. regionCount) {
4922 region := regions[i]
4923 }
4924
Jesse Hall3fbc8562015-11-29 22:10:52 -08004925 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4926 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004927
Jesse Hall65ab5522015-11-30 00:07:16 -08004928 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004929}
4930
4931@threadSafety("app")
4932cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004933 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004934 VkImage srcImage,
4935 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004936 VkImage dstImage,
4937 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004938 u32 regionCount,
4939 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004940 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004941 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004942 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004943 dstImageObject := GetImage(dstImage)
4944 assert(commandBufferObject.device == srcImageObject.device)
4945 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004946
4947 regions := pRegions[0:regionCount]
4948 for i in (0 .. regionCount) {
4949 region := regions[i]
4950 }
4951
Jesse Hall3fbc8562015-11-29 22:10:52 -08004952 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4953 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004954
Jesse Hall3fbc8562015-11-29 22:10:52 -08004955 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004956}
4957
4958@threadSafety("app")
4959cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004960 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004961 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004962 VkImage dstImage,
4963 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004964 u32 regionCount,
4965 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004966 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004967 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004968 dstImageObject := GetImage(dstImage)
4969 assert(commandBufferObject.device == srcBufferObject.device)
4970 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004971
4972 regions := pRegions[0:regionCount]
4973 for i in (0 .. regionCount) {
4974 region := regions[i]
4975 }
4976
Jesse Hall3fbc8562015-11-29 22:10:52 -08004977 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4978 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004979
Jesse Hall65ab5522015-11-30 00:07:16 -08004980 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004981}
4982
4983@threadSafety("app")
4984cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004985 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004986 VkImage srcImage,
4987 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004988 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004989 u32 regionCount,
4990 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004991 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004992 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004993 dstBufferObject := GetBuffer(dstBuffer)
4994 assert(commandBufferObject.device == srcImageObject.device)
4995 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004996
4997 regions := pRegions[0:regionCount]
4998 for i in (0 .. regionCount) {
4999 region := regions[i]
5000 }
5001
Jesse Hall3fbc8562015-11-29 22:10:52 -08005002 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5003 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005004
Jesse Hall65ab5522015-11-30 00:07:16 -08005005 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005006}
5007
5008@threadSafety("app")
5009cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005010 VkCommandBuffer commandBuffer,
5011 VkBuffer dstBuffer,
5012 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005013 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005014 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005015 commandBufferObject := GetCommandBuffer(commandBuffer)
5016 dstBufferObject := GetBuffer(dstBuffer)
5017 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005018
5019 data := pData[0:dataSize]
5020
Jesse Hall3fbc8562015-11-29 22:10:52 -08005021 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005022
Jesse Hall65ab5522015-11-30 00:07:16 -08005023 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005024}
5025
5026@threadSafety("app")
5027cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005028 VkCommandBuffer commandBuffer,
5029 VkBuffer dstBuffer,
5030 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005031 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005032 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005033 commandBufferObject := GetCommandBuffer(commandBuffer)
5034 dstBufferObject := GetBuffer(dstBuffer)
5035 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005036
Jesse Hall65ab5522015-11-30 00:07:16 -08005037 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005038}
5039
5040@threadSafety("app")
5041cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005042 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005043 VkImage image,
5044 VkImageLayout imageLayout,
5045 const VkClearColorValue* pColor,
5046 u32 rangeCount,
5047 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005048 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005049 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005050 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005051
5052 ranges := pRanges[0:rangeCount]
5053 for i in (0 .. rangeCount) {
5054 range := ranges[i]
5055 }
5056
Jesse Hall3fbc8562015-11-29 22:10:52 -08005057 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005058
Jesse Hall3fbc8562015-11-29 22:10:52 -08005059 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005060}
5061
5062@threadSafety("app")
5063cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005064 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005065 VkImage image,
5066 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005067 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005068 u32 rangeCount,
5069 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005070 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005071 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005072 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005073
5074 ranges := pRanges[0:rangeCount]
5075 for i in (0 .. rangeCount) {
5076 range := ranges[i]
5077 }
5078
Jesse Hall3fbc8562015-11-29 22:10:52 -08005079 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005080
Jesse Hall3fbc8562015-11-29 22:10:52 -08005081 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005082}
5083
5084@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005085cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005086 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005087 u32 attachmentCount,
5088 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005089 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005090 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005091 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005092
5093 rects := pRects[0:rectCount]
5094 for i in (0 .. rectCount) {
5095 rect := rects[i]
5096 }
5097
Jesse Hall3fbc8562015-11-29 22:10:52 -08005098 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005099}
5100
5101@threadSafety("app")
5102cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005103 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005104 VkImage srcImage,
5105 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005106 VkImage dstImage,
5107 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005108 u32 regionCount,
5109 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005110 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005111 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005112 dstImageObject := GetImage(dstImage)
5113 assert(commandBufferObject.device == srcImageObject.device)
5114 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005115
5116 regions := pRegions[0:regionCount]
5117 for i in (0 .. regionCount) {
5118 region := regions[i]
5119 }
5120
Jesse Hall3fbc8562015-11-29 22:10:52 -08005121 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5122 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005123
Jesse Hall3fbc8562015-11-29 22:10:52 -08005124 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005125}
5126
5127@threadSafety("app")
5128cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005129 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005130 VkEvent event,
5131 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005132 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005133 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005134 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005135}
5136
5137@threadSafety("app")
5138cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005139 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005140 VkEvent event,
5141 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005142 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005143 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005144 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005145}
5146
5147@threadSafety("app")
5148cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005149 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005150 u32 eventCount,
5151 const VkEvent* pEvents,
5152 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005153 VkPipelineStageFlags dstStageMask,
5154 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005155 const VkMemoryBarrier* pMemoryBarriers,
5156 u32 bufferMemoryBarrierCount,
5157 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5158 u32 imageMemoryBarrierCount,
5159 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005160 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005161
5162 events := pEvents[0:eventCount]
5163 for i in (0 .. eventCount) {
5164 event := events[i]
5165 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005166 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005167 }
5168
Jesse Hall3dd678a2016-01-08 21:52:01 -08005169 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005170 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005171 memoryBarrier := memoryBarriers[i]
5172 }
5173 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5174 for i in (0 .. bufferMemoryBarrierCount) {
5175 bufferMemoryBarrier := bufferMemoryBarriers[i]
5176 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5177 assert(bufferObject.device == commandBufferObject.device)
5178 }
5179 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5180 for i in (0 .. imageMemoryBarrierCount) {
5181 imageMemoryBarrier := imageMemoryBarriers[i]
5182 imageObject := GetImage(imageMemoryBarrier.image)
5183 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005184 }
5185}
5186
5187@threadSafety("app")
5188cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005189 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005190 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005191 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005192 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005193 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005194 const VkMemoryBarrier* pMemoryBarriers,
5195 u32 bufferMemoryBarrierCount,
5196 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5197 u32 imageMemoryBarrierCount,
5198 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005199 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005200
Jesse Hall3dd678a2016-01-08 21:52:01 -08005201 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005202 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005203 memoryBarrier := memoryBarriers[i]
5204 }
5205 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5206 for i in (0 .. bufferMemoryBarrierCount) {
5207 bufferMemoryBarrier := bufferMemoryBarriers[i]
5208 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5209 assert(bufferObject.device == commandBufferObject.device)
5210 }
5211 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5212 for i in (0 .. imageMemoryBarrierCount) {
5213 imageMemoryBarrier := imageMemoryBarriers[i]
5214 imageObject := GetImage(imageMemoryBarrier.image)
5215 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005216 }
5217}
5218
5219@threadSafety("app")
5220cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005221 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005222 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005223 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005224 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005225 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005226 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005227 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005228}
5229
5230@threadSafety("app")
5231cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005232 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005233 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005234 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005235 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005236 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005237 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005238}
5239
5240@threadSafety("app")
5241cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005242 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005243 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005244 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005245 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005246 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005247 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005248 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005249}
5250
5251@threadSafety("app")
5252cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005253 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005254 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005255 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005256 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005257 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005258 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005259 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005260}
5261
5262@threadSafety("app")
5263cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005264 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005265 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005266 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005267 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005268 VkBuffer dstBuffer,
5269 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005270 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005271 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005272 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005273 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005274 dstBufferObject := GetBuffer(dstBuffer)
5275 assert(commandBufferObject.device == queryPoolObject.device)
5276 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005277}
5278
5279cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005280 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005281 VkPipelineLayout layout,
5282 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005283 u32 offset,
5284 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005285 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005286 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005287 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005288 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005289}
5290
5291@threadSafety("app")
5292cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005293 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005294 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005295 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005296 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005297 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5298 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005299 assert(commandBufferObject.device == renderPassObject.device)
5300 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005301
Jesse Hall3fbc8562015-11-29 22:10:52 -08005302 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005303}
5304
5305cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005306 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005307 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005308 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005309}
5310
5311@threadSafety("app")
5312cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005313 VkCommandBuffer commandBuffer) {
5314 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005315
Jesse Hall3fbc8562015-11-29 22:10:52 -08005316 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005317}
5318
5319cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005320 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005321 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005322 const VkCommandBuffer* pCommandBuffers) {
5323 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005324
Jesse Hall3dd678a2016-01-08 21:52:01 -08005325 commandBuffers := pCommandBuffers[0:commandBufferCount]
5326 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005327 secondaryCommandBuffer := commandBuffers[i]
5328 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5329 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005330 }
5331}
5332
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005333@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005334cmd void vkDestroySurfaceKHR(
5335 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005336 VkSurfaceKHR surface,
5337 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005338 instanceObject := GetInstance(instance)
5339 surfaceObject := GetSurface(surface)
5340 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005341
Jesse Hall1356b0d2015-11-23 17:24:58 -08005342 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005343}
5344
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005345@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005346cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005347 VkPhysicalDevice physicalDevice,
5348 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005349 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005350 VkBool32* pSupported) {
5351 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005352
5353 return ?
5354}
5355
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005356@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005357cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5358 VkPhysicalDevice physicalDevice,
5359 VkSurfaceKHR surface,
5360 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5361 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5362
5363 surfaceCapabilities := ?
5364 pSurfaceCapabilities[0] = surfaceCapabilities
5365
5366 return ?
5367}
5368
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005369@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005370cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5371 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005372 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005373 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005374 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005375 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005376
5377 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005378 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005379 surfaceFormats := pSurfaceFormats[0:count]
5380
5381 for i in (0 .. count) {
5382 surfaceFormat := ?
5383 surfaceFormats[i] = surfaceFormat
5384 }
5385
5386 return ?
5387}
5388
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005389@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005390cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5391 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005392 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005393 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005394 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005395 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005396
5397 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005398 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005399 presentModes := pPresentModes[0:count]
5400
5401 for i in (0 .. count) {
5402 presentMode := ?
5403 presentModes[i] = presentMode
5404 }
5405
5406 return ?
5407}
5408
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005409@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005410cmd VkResult vkCreateSwapchainKHR(
5411 VkDevice device,
5412 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005413 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005414 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005415 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005416 deviceObject := GetDevice(device)
5417
5418 swapchain := ?
5419 pSwapchain[0] = swapchain
5420 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5421
5422 return ?
5423}
5424
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005425@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005426cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005427 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005428 VkSwapchainKHR swapchain,
5429 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005430 deviceObject := GetDevice(device)
5431 swapchainObject := GetSwapchain(swapchain)
5432 assert(swapchainObject.device == device)
5433
5434 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005435}
5436
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005437@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005438cmd VkResult vkGetSwapchainImagesKHR(
5439 VkDevice device,
5440 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005441 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005442 VkImage* pSwapchainImages) {
5443 deviceObject := GetDevice(device)
5444
5445 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005446 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005447 swapchainImages := pSwapchainImages[0:count]
5448
5449 for i in (0 .. count) {
5450 swapchainImage := ?
5451 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005452 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005453 }
5454
5455 return ?
5456}
5457
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005458@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005459cmd VkResult vkAcquireNextImageKHR(
5460 VkDevice device,
5461 VkSwapchainKHR swapchain,
5462 u64 timeout,
5463 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005464 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005465 u32* pImageIndex) {
5466 deviceObject := GetDevice(device)
5467 swapchainObject := GetSwapchain(swapchain)
5468
5469 imageIndex := ?
5470 pImageIndex[0] = imageIndex
5471
5472 return ?
5473}
5474
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005475@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005476cmd VkResult vkQueuePresentKHR(
5477 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005478 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005479 queueObject := GetQueue(queue)
5480
5481 presentInfo := ?
5482 pPresentInfo[0] = presentInfo
5483
5484 return ?
5485}
5486
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005487@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005488cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5489 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005490 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005491 VkDisplayPropertiesKHR* pProperties) {
5492 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5493 return ?
5494}
5495
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005496@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005497cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5498 VkPhysicalDevice physicalDevice,
5499 u32* pPropertyCount,
5500 VkDisplayPlanePropertiesKHR* pProperties) {
5501 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5502 return ?
5503}
5504
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005505@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005506cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5507 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005508 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005509 u32* pDisplayCount,
5510 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005511 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5512 return ?
5513}
5514
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005515@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005516cmd VkResult vkGetDisplayModePropertiesKHR(
5517 VkPhysicalDevice physicalDevice,
5518 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005519 u32* pPropertyCount,
5520 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005521 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5522 return ?
5523}
5524
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005525@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005526cmd VkResult vkCreateDisplayModeKHR(
5527 VkPhysicalDevice physicalDevice,
5528 VkDisplayKHR display,
5529 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005530 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005531 VkDisplayModeKHR* pMode) {
5532 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5533 return ?
5534}
5535
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005536@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005537cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005538 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005539 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005540 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005541 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005542 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5543 return ?
5544}
5545
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005546@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005547cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5548 VkInstance instance,
5549 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005550 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005551 VkSurfaceKHR* pSurface) {
5552 return ?
5553}
5554
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005555@extension("VK_KHR_display_swapchain")
5556cmd VkResult vkCreateSharedSwapchainsKHR(
5557 VkDevice device,
5558 u32 swapchainCount,
5559 const VkSwapchainCreateInfoKHR* pCreateInfos,
5560 const VkAllocationCallbacks* pAllocator,
5561 VkSwapchainKHR* pSwapchains) {
5562 return ?
5563}
5564
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005565@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005566cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005567 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005568 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005569 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005570 VkSurfaceKHR* pSurface) {
5571 instanceObject := GetInstance(instance)
5572 return ?
5573}
5574
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005575@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005576cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5577 VkPhysicalDevice physicalDevice,
5578 u32 queueFamilyIndex,
5579 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005580 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005581 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5582 return ?
5583}
5584
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005585@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005586cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005587 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005588 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005589 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005590 VkSurfaceKHR* pSurface) {
5591 instanceObject := GetInstance(instance)
5592 return ?
5593}
5594
Jesse Hall523db342015-11-30 21:12:55 -08005595@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005596cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5597 VkPhysicalDevice physicalDevice,
5598 u32 queueFamilyIndex,
5599 platform.xcb_connection_t* connection,
5600 platform.xcb_visualid_t visual_id) {
5601 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5602 return ?
5603}
5604
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005605@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005606cmd VkResult vkCreateWaylandSurfaceKHR(
5607 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005608 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005609 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005610 VkSurfaceKHR* pSurface) {
5611 instanceObject := GetInstance(instance)
5612 return ?
5613}
5614
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005615@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005616cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5617 VkPhysicalDevice physicalDevice,
5618 u32 queueFamilyIndex,
5619 platform.wl_display* display) {
5620 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5621 return ?
5622}
5623
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005624@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005625cmd VkResult vkCreateMirSurfaceKHR(
5626 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005627 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005628 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005629 VkSurfaceKHR* pSurface) {
5630 instanceObject := GetInstance(instance)
5631 return ?
5632}
5633
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005634@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005635cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5636 VkPhysicalDevice physicalDevice,
5637 u32 queueFamilyIndex,
5638 platform.MirConnection* connection) {
5639 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5640 return ?
5641}
5642
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005643@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005644cmd VkResult vkCreateAndroidSurfaceKHR(
5645 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005646 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005647 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005648 VkSurfaceKHR* pSurface) {
5649 instanceObject := GetInstance(instance)
5650 return ?
5651}
5652
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005653@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005654cmd VkResult vkCreateWin32SurfaceKHR(
5655 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005656 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005657 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005658 VkSurfaceKHR* pSurface) {
5659 instanceObject := GetInstance(instance)
5660 return ?
5661}
5662
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005663@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005664cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5665 VkPhysicalDevice physicalDevice,
5666 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005667 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005668 return ?
5669}
5670
Chia-I Wub262ddc2016-03-22 07:38:20 +08005671@extension("VK_ANDROID_native_buffer")
5672cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5673 VkDevice device,
5674 VkFormat format,
5675 VkImageUsageFlags imageUsage,
5676 int* grallocUsage) {
5677 return ?
5678}
5679
5680@extension("VK_ANDROID_native_buffer")
Chris Forbes8e4438b2016-12-07 16:26:49 +13005681cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5682 VkDevice device,
5683 VkFormat format,
5684 VkImageUsageFlags imageUsage,
5685 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
5686 int* grallocUsage) {
5687 return ?
5688}
5689
5690@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005691cmd VkResult vkAcquireImageANDROID(
5692 VkDevice device,
5693 VkImage image,
5694 int nativeFenceFd,
5695 VkSemaphore semaphore,
5696 VkFence fence) {
5697 return ?
5698}
5699
5700@extension("VK_ANDROID_native_buffer")
5701cmd VkResult vkQueueSignalReleaseImageANDROID(
5702 VkQueue queue,
5703 u32 waitSemaphoreCount,
5704 const VkSemaphore* pWaitSemaphores,
5705 VkImage image,
5706 int* pNativeFenceFd) {
5707 return ?
5708}
5709
Jesse Hall715b86a2016-01-16 16:34:29 -08005710@extension("VK_EXT_debug_report")
5711@external type void* PFN_vkDebugReportCallbackEXT
5712@extension("VK_EXT_debug_report")
5713@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5714 VkDebugReportFlagsEXT flags,
5715 VkDebugReportObjectTypeEXT objectType,
5716 u64 object,
5717 platform.size_t location,
5718 s32 messageCode,
5719 const char* pLayerPrefix,
5720 const char* pMessage,
5721 void* pUserData) {
5722 return ?
5723}
5724
5725@extension("VK_EXT_debug_report")
5726cmd VkResult vkCreateDebugReportCallbackEXT(
5727 VkInstance instance,
5728 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5729 const VkAllocationCallbacks* pAllocator,
5730 VkDebugReportCallbackEXT* pCallback) {
5731 return ?
5732}
5733
5734@extension("VK_EXT_debug_report")
5735cmd void vkDestroyDebugReportCallbackEXT(
5736 VkInstance instance,
5737 VkDebugReportCallbackEXT callback,
5738 const VkAllocationCallbacks* pAllocator) {
5739}
5740
5741@extension("VK_EXT_debug_report")
5742cmd void vkDebugReportMessageEXT(
5743 VkInstance instance,
5744 VkDebugReportFlagsEXT flags,
5745 VkDebugReportObjectTypeEXT objectType,
5746 u64 object,
5747 platform.size_t location,
5748 s32 messageCode,
5749 const char* pLayerPrefix,
5750 const char* pMessage) {
5751}
5752
Jesse Hall26763382016-05-20 07:13:52 -07005753@extension("VK_EXT_debug_marker")
5754cmd VkResult vkDebugMarkerSetObjectTagEXT(
5755 VkDevice device,
5756 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5757 return ?
5758}
5759
5760@extension("VK_EXT_debug_marker")
5761cmd VkResult vkDebugMarkerSetObjectNameEXT(
5762 VkDevice device,
5763 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5764 return ?
5765}
5766
5767@extension("VK_EXT_debug_marker")
5768cmd void vkCmdDebugMarkerBeginEXT(
5769 VkCommandBuffer commandBuffer,
5770 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5771}
5772
5773@extension("VK_EXT_debug_marker")
5774cmd void vkCmdDebugMarkerEndEXT(
5775 VkCommandBuffer commandBuffer) {
5776}
5777
5778@extension("VK_EXT_debug_marker")
5779cmd void vkCmdDebugMarkerInsertEXT(
5780 VkCommandBuffer commandBuffer,
5781 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5782}
5783
Chris Forbes289cb792016-12-30 15:03:55 +13005784@extension("VK_AMD_draw_indirect_count")
5785cmd void vkCmdDrawIndirectCountAMD(
5786 VkCommandBuffer commandBuffer,
5787 VkBuffer buffer,
5788 VkDeviceSize offset,
5789 VkBuffer countBuffer,
5790 VkDeviceSize countBufferOffset,
5791 u32 maxDrawCount,
5792 u32 stride) {
5793}
5794
5795@extension("VK_AMD_draw_indirect_count")
5796cmd void vkCmdDrawIndexedIndirectCountAMD(
5797 VkCommandBuffer commandBuffer,
5798 VkBuffer buffer,
5799 VkDeviceSize offset,
5800 VkBuffer countBuffer,
5801 VkDeviceSize countBufferOffset,
5802 u32 maxDrawCount,
5803 u32 stride) {
5804}
5805
5806@extension("VK_NV_external_memory_capabilities")
5807cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
5808 VkPhysicalDevice physicalDevice,
5809 VkFormat format,
5810 VkImageType type,
5811 VkImageTiling tiling,
5812 VkImageUsageFlags usage,
5813 VkImageCreateFlags flags,
5814 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
5815 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
5816 return ?
5817}
5818
5819@extension("VK_NV_external_memory_win32")
5820cmd VkResult vkGetMemoryWin32HandleNV(
5821 VkDevice device,
5822 VkDeviceMemory memory,
5823 VkExternalMemoryHandleTypeFlagsNV handleType,
5824 platform.HANDLE* pHandle) {
5825 return ?
5826}
5827
5828@extension("VK_NV_external_memory_win32")
5829cmd void vkCmdProcessCommandsNVX(
5830 VkCommandBuffer commandBuffer,
5831 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
5832}
5833
5834@extension("VK_NV_external_memory_win32")
5835cmd void vkCmdReserveSpaceForCommandsNVX(
5836 VkCommandBuffer commandBuffer,
5837 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
5838}
5839
5840@extension("VK_NV_external_memory_win32")
5841cmd VkResult vkCreateIndirectCommandsLayoutNVX(
5842 VkDevice device,
5843 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
5844 const VkAllocationCallbacks* pAllocator,
5845 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
5846 return ?
5847}
5848
5849@extension("VK_NV_external_memory_win32")
5850cmd void vkDestroyIndirectCommandsLayoutNVX(
5851 VkDevice device,
5852 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
5853 const VkAllocationCallbacks* pAllocator) {
5854}
5855
5856@extension("VK_NV_external_memory_win32")
5857cmd VkResult vkCreateObjectTableNVX(
5858 VkDevice device,
5859 const VkObjectTableCreateInfoNVX* pCreateInfo,
5860 const VkAllocationCallbacks* pAllocator,
5861 VkObjectTableNVX* pObjectTable) {
5862 return ?
5863}
5864
5865@extension("VK_NV_external_memory_win32")
5866cmd void vkDestroyObjectTableNVX(
5867 VkDevice device,
5868 VkObjectTableNVX objectTable,
5869 const VkAllocationCallbacks* pAllocator) {
5870}
5871
5872@extension("VK_NV_external_memory_win32")
5873cmd VkResult vkRegisterObjectsNVX(
5874 VkDevice device,
5875 VkObjectTableNVX objectTable,
5876 u32 objectCount,
5877 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
5878 const u32* pObjectIndices) {
5879 return ?
5880}
5881
5882@extension("VK_NV_external_memory_win32")
5883cmd VkResult vkUnregisterObjectsNVX(
5884 VkDevice device,
5885 VkObjectTableNVX objectTable,
5886 u32 objectCount,
5887 const VkObjectEntryTypeNVX* pObjectEntryTypes,
5888 const u32* pObjectIndices) {
5889 return ?
5890}
5891
5892@extension("VK_NV_external_memory_win32")
5893cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
5894 VkPhysicalDevice physicalDevice,
5895 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
5896 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
5897}
5898
Jesse Halld27f6aa2015-08-15 17:58:48 -07005899
5900////////////////
5901// Validation //
5902////////////////
5903
5904extern void validate(string layerName, bool condition, string message)
5905
5906
5907/////////////////////////////
5908// Internal State Tracking //
5909/////////////////////////////
5910
5911StateObject State
5912
5913@internal class StateObject {
5914 // Dispatchable objects.
5915 map!(VkInstance, ref!InstanceObject) Instances
5916 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5917 map!(VkDevice, ref!DeviceObject) Devices
5918 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005919 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005920
5921 // Non-dispatchable objects.
5922 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5923 map!(VkBuffer, ref!BufferObject) Buffers
5924 map!(VkBufferView, ref!BufferViewObject) BufferViews
5925 map!(VkImage, ref!ImageObject) Images
5926 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005927 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005928 map!(VkPipeline, ref!PipelineObject) Pipelines
5929 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5930 map!(VkSampler, ref!SamplerObject) Samplers
5931 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5932 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5933 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005934 map!(VkFence, ref!FenceObject) Fences
5935 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5936 map!(VkEvent, ref!EventObject) Events
5937 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5938 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5939 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5940 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005941 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005942 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005943 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005944}
5945
5946@internal class InstanceObject {
5947}
5948
5949@internal class PhysicalDeviceObject {
5950 VkInstance instance
5951}
5952
5953@internal class DeviceObject {
5954 VkPhysicalDevice physicalDevice
5955}
5956
5957@internal class QueueObject {
5958 VkDevice device
5959 VkQueueFlags flags
5960}
5961
Jesse Hall3fbc8562015-11-29 22:10:52 -08005962@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005963 VkDevice device
5964 map!(u64, VkDeviceMemory) boundObjects
5965 VkQueueFlags queueFlags
5966}
5967
5968@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005969 VkDevice device
5970 VkDeviceSize allocationSize
5971 map!(u64, VkDeviceSize) boundObjects
5972 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005973}
5974
5975@internal class BufferObject {
5976 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005977 VkDeviceMemory memory
5978 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005979}
5980
5981@internal class BufferViewObject {
5982 VkDevice device
5983 VkBuffer buffer
5984}
5985
5986@internal class ImageObject {
5987 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005988 VkDeviceMemory memory
5989 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005990}
5991
5992@internal class ImageViewObject {
5993 VkDevice device
5994 VkImage image
5995}
5996
Jesse Halld27f6aa2015-08-15 17:58:48 -07005997@internal class ShaderObject {
5998 VkDevice device
5999}
6000
6001@internal class ShaderModuleObject {
6002 VkDevice device
6003}
6004
6005@internal class PipelineObject {
6006 VkDevice device
6007}
6008
6009@internal class PipelineLayoutObject {
6010 VkDevice device
6011}
6012
6013@internal class SamplerObject {
6014 VkDevice device
6015}
6016
6017@internal class DescriptorSetObject {
6018 VkDevice device
6019}
6020
6021@internal class DescriptorSetLayoutObject {
6022 VkDevice device
6023}
6024
6025@internal class DescriptorPoolObject {
6026 VkDevice device
6027}
6028
Jesse Halld27f6aa2015-08-15 17:58:48 -07006029@internal class FenceObject {
6030 VkDevice device
6031 bool signaled
6032}
6033
6034@internal class SemaphoreObject {
6035 VkDevice device
6036}
6037
6038@internal class EventObject {
6039 VkDevice device
6040}
6041
6042@internal class QueryPoolObject {
6043 VkDevice device
6044}
6045
6046@internal class FramebufferObject {
6047 VkDevice device
6048}
6049
6050@internal class RenderPassObject {
6051 VkDevice device
6052}
6053
6054@internal class PipelineCacheObject {
6055 VkDevice device
6056}
6057
Jesse Hall3fbc8562015-11-29 22:10:52 -08006058@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006059 VkDevice device
6060}
6061
Jesse Hall1356b0d2015-11-23 17:24:58 -08006062@internal class SurfaceObject {
6063 VkInstance instance
6064}
6065
Michael Lentine88594d72015-11-12 12:49:45 -08006066@internal class SwapchainObject {
6067 VkDevice device
6068}
6069
Jesse Halld27f6aa2015-08-15 17:58:48 -07006070macro ref!InstanceObject GetInstance(VkInstance instance) {
6071 assert(instance in State.Instances)
6072 return State.Instances[instance]
6073}
6074
6075macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6076 assert(physicalDevice in State.PhysicalDevices)
6077 return State.PhysicalDevices[physicalDevice]
6078}
6079
6080macro ref!DeviceObject GetDevice(VkDevice device) {
6081 assert(device in State.Devices)
6082 return State.Devices[device]
6083}
6084
6085macro ref!QueueObject GetQueue(VkQueue queue) {
6086 assert(queue in State.Queues)
6087 return State.Queues[queue]
6088}
6089
Jesse Hall3fbc8562015-11-29 22:10:52 -08006090macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6091 assert(commandBuffer in State.CommandBuffers)
6092 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006093}
6094
Jesse Hall3fbc8562015-11-29 22:10:52 -08006095macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6096 assert(memory in State.DeviceMemories)
6097 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006098}
6099
6100macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6101 assert(buffer in State.Buffers)
6102 return State.Buffers[buffer]
6103}
6104
6105macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6106 assert(bufferView in State.BufferViews)
6107 return State.BufferViews[bufferView]
6108}
6109
6110macro ref!ImageObject GetImage(VkImage image) {
6111 assert(image in State.Images)
6112 return State.Images[image]
6113}
6114
6115macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6116 assert(imageView in State.ImageViews)
6117 return State.ImageViews[imageView]
6118}
6119
Jesse Halld27f6aa2015-08-15 17:58:48 -07006120macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6121 assert(shaderModule in State.ShaderModules)
6122 return State.ShaderModules[shaderModule]
6123}
6124
6125macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6126 assert(pipeline in State.Pipelines)
6127 return State.Pipelines[pipeline]
6128}
6129
6130macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6131 assert(pipelineLayout in State.PipelineLayouts)
6132 return State.PipelineLayouts[pipelineLayout]
6133}
6134
6135macro ref!SamplerObject GetSampler(VkSampler sampler) {
6136 assert(sampler in State.Samplers)
6137 return State.Samplers[sampler]
6138}
6139
6140macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6141 assert(descriptorSet in State.DescriptorSets)
6142 return State.DescriptorSets[descriptorSet]
6143}
6144
6145macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6146 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6147 return State.DescriptorSetLayouts[descriptorSetLayout]
6148}
6149
6150macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6151 assert(descriptorPool in State.DescriptorPools)
6152 return State.DescriptorPools[descriptorPool]
6153}
6154
Jesse Halld27f6aa2015-08-15 17:58:48 -07006155macro ref!FenceObject GetFence(VkFence fence) {
6156 assert(fence in State.Fences)
6157 return State.Fences[fence]
6158}
6159
6160macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6161 assert(semaphore in State.Semaphores)
6162 return State.Semaphores[semaphore]
6163}
6164
6165macro ref!EventObject GetEvent(VkEvent event) {
6166 assert(event in State.Events)
6167 return State.Events[event]
6168}
6169
6170macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6171 assert(queryPool in State.QueryPools)
6172 return State.QueryPools[queryPool]
6173}
6174
6175macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6176 assert(framebuffer in State.Framebuffers)
6177 return State.Framebuffers[framebuffer]
6178}
6179
6180macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6181 assert(renderPass in State.RenderPasses)
6182 return State.RenderPasses[renderPass]
6183}
6184
6185macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6186 assert(pipelineCache in State.PipelineCaches)
6187 return State.PipelineCaches[pipelineCache]
6188}
6189
Jesse Hall3fbc8562015-11-29 22:10:52 -08006190macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6191 assert(commandPool in State.CommandPools)
6192 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006193}
Michael Lentine88594d72015-11-12 12:49:45 -08006194
Jesse Hall1356b0d2015-11-23 17:24:58 -08006195macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6196 assert(surface in State.Surfaces)
6197 return State.Surfaces[surface]
6198}
6199
Michael Lentine88594d72015-11-12 12:49:45 -08006200macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6201 assert(swapchain in State.Swapchains)
6202 return State.Swapchains[swapchain]
6203}
Jesse Halld8bade02015-11-24 10:24:18 -08006204
6205macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6206 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6207}