Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1 | // 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 | |
| 22 | import platform "platform.api" |
| 23 | |
| 24 | /////////////// |
| 25 | // Constants // |
| 26 | /////////////// |
| 27 | |
| 28 | // API version (major.minor.patch) |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 29 | define VERSION_MAJOR 1 |
| 30 | define VERSION_MINOR 0 |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 31 | define VERSION_PATCH 38 |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 32 | |
| 33 | // API limits |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 34 | define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 |
| 35 | define VK_UUID_SIZE 16 |
| 36 | define VK_MAX_EXTENSION_NAME_SIZE 256 |
| 37 | define VK_MAX_DESCRIPTION_SIZE 256 |
| 38 | define VK_MAX_MEMORY_TYPES 32 |
| 39 | define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types. |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 40 | |
| 41 | // API keywords |
| 42 | define VK_TRUE 1 |
| 43 | define VK_FALSE 0 |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 44 | |
| 45 | // API keyword, but needs special handling by some templates |
| 46 | define NULL_HANDLE 0 |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 47 | |
Jesse Hall | 33faaad | 2016-01-24 21:00:49 -0800 | [diff] [blame] | 48 | @extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 49 | @extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 50 | |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 51 | @extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 52 | @extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 53 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 54 | @extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 55 | @extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 56 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 57 | @extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9 |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 58 | @extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 59 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 60 | @extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 61 | @extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 62 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 63 | @extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 64 | @extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 65 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 66 | @extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 67 | @extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 68 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 69 | @extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 70 | @extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 71 | |
Jesse Hall | 33faaad | 2016-01-24 21:00:49 -0800 | [diff] [blame] | 72 | @extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 73 | @extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 74 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 75 | @extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 76 | @extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 77 | |
Ian Elliott | 948233a | 2017-01-06 12:13:23 -0700 | [diff] [blame] | 78 | @extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1 |
| 79 | @extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_NAME "VK_KHR_incremental_present" |
| 80 | |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 81 | @extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6 |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 82 | @extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer" |
| 83 | |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 84 | @extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1 |
| 85 | @extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_NAME "VK_GOOGLE_display_timing" |
| 86 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 87 | @extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4 |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 88 | @extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report" |
| 89 | |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 90 | @extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1 |
| 91 | @extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader" |
| 92 | |
| 93 | @extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1 |
| 94 | @extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge" |
| 95 | |
| 96 | @extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1 |
| 97 | @extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic" |
| 98 | |
| 99 | @extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1 |
| 100 | @extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order" |
| 101 | |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 102 | @extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1 |
| 103 | @extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax" |
| 104 | |
| 105 | @extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1 |
| 106 | @extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter" |
| 107 | |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 108 | @extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3 |
| 109 | @extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker" |
| 110 | |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 111 | @extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1 |
| 112 | @extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader" |
| 113 | |
| 114 | @extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1 |
| 115 | @extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation" |
| 116 | |
Chris Forbes | 1194ede | 2016-12-30 16:29:25 +1300 | [diff] [blame] | 117 | @extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1 |
| 118 | @extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2" |
| 119 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 120 | @extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1 |
| 121 | @extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count" |
| 122 | |
| 123 | @extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1 |
| 124 | @extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height" |
| 125 | |
| 126 | @extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1 |
| 127 | @extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float" |
| 128 | |
| 129 | @extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1 |
| 130 | @extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot" |
| 131 | |
| 132 | @extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1 |
| 133 | @extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc" |
| 134 | |
| 135 | @extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 |
| 136 | @extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities" |
| 137 | |
| 138 | @extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1 |
| 139 | @extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory" |
| 140 | |
| 141 | @extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 |
| 142 | @extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32" |
| 143 | |
| 144 | @extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1 |
| 145 | @extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex" |
| 146 | |
| 147 | @extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1 |
| 148 | @extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" |
| 149 | |
| 150 | @extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1 |
| 151 | @extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands" |
| 152 | |
Chris Forbes | 1d5f68c | 2017-01-31 10:17:01 +1300 | [diff] [blame] | 153 | @extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1 |
| 154 | @extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME "VK_KHR_shared_presentable_image" |
Chris Forbes | 2e12cb8 | 2017-01-18 11:45:17 +1300 | [diff] [blame] | 155 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 156 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 157 | |
| 158 | ///////////// |
| 159 | // Types // |
| 160 | ///////////// |
| 161 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 162 | type u32 VkBool32 |
| 163 | type u32 VkFlags |
| 164 | type u64 VkDeviceSize |
| 165 | type u32 VkSampleMask |
| 166 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 167 | /// Dispatchable handle types. |
| 168 | @dispatchHandle type u64 VkInstance |
| 169 | @dispatchHandle type u64 VkPhysicalDevice |
| 170 | @dispatchHandle type u64 VkDevice |
| 171 | @dispatchHandle type u64 VkQueue |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 172 | @dispatchHandle type u64 VkCommandBuffer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 173 | |
| 174 | /// Non dispatchable handle types. |
| 175 | @nonDispatchHandle type u64 VkDeviceMemory |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 176 | @nonDispatchHandle type u64 VkCommandPool |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 177 | @nonDispatchHandle type u64 VkBuffer |
| 178 | @nonDispatchHandle type u64 VkBufferView |
| 179 | @nonDispatchHandle type u64 VkImage |
| 180 | @nonDispatchHandle type u64 VkImageView |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 181 | @nonDispatchHandle type u64 VkShaderModule |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 182 | @nonDispatchHandle type u64 VkPipeline |
| 183 | @nonDispatchHandle type u64 VkPipelineLayout |
| 184 | @nonDispatchHandle type u64 VkSampler |
| 185 | @nonDispatchHandle type u64 VkDescriptorSet |
| 186 | @nonDispatchHandle type u64 VkDescriptorSetLayout |
| 187 | @nonDispatchHandle type u64 VkDescriptorPool |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 188 | @nonDispatchHandle type u64 VkFence |
| 189 | @nonDispatchHandle type u64 VkSemaphore |
| 190 | @nonDispatchHandle type u64 VkEvent |
| 191 | @nonDispatchHandle type u64 VkQueryPool |
| 192 | @nonDispatchHandle type u64 VkFramebuffer |
| 193 | @nonDispatchHandle type u64 VkRenderPass |
| 194 | @nonDispatchHandle type u64 VkPipelineCache |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 195 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 196 | @extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 197 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 198 | @extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 199 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 200 | @extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR |
| 201 | @extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 202 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 203 | @extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT |
| 204 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 205 | @extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX |
| 206 | @extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX |
| 207 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 208 | |
| 209 | ///////////// |
| 210 | // Enums // |
| 211 | ///////////// |
| 212 | |
| 213 | enum VkImageLayout { |
| 214 | VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation) |
| 215 | VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access |
| 216 | VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write |
| 217 | VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write |
| 218 | VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access |
| 219 | VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 0x00000005, /// Optimal layout when image is used for read only shader access |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 220 | VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations |
| 221 | VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 0x00000007, /// Optimal layout when image is used only as destination of transfer operations |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 222 | VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 223 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 224 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 225 | VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | enum VkAttachmentLoadOp { |
| 229 | VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000, |
| 230 | VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001, |
| 231 | VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002, |
| 232 | } |
| 233 | |
| 234 | enum VkAttachmentStoreOp { |
| 235 | VK_ATTACHMENT_STORE_OP_STORE = 0x00000000, |
| 236 | VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001, |
| 237 | } |
| 238 | |
| 239 | enum VkImageType { |
| 240 | VK_IMAGE_TYPE_1D = 0x00000000, |
| 241 | VK_IMAGE_TYPE_2D = 0x00000001, |
| 242 | VK_IMAGE_TYPE_3D = 0x00000002, |
| 243 | } |
| 244 | |
| 245 | enum VkImageTiling { |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 246 | VK_IMAGE_TILING_OPTIMAL = 0x00000000, |
| 247 | VK_IMAGE_TILING_LINEAR = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | enum VkImageViewType { |
| 251 | VK_IMAGE_VIEW_TYPE_1D = 0x00000000, |
| 252 | VK_IMAGE_VIEW_TYPE_2D = 0x00000001, |
| 253 | VK_IMAGE_VIEW_TYPE_3D = 0x00000002, |
| 254 | VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003, |
| 255 | VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004, |
| 256 | VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005, |
| 257 | VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006, |
| 258 | } |
| 259 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 260 | enum VkCommandBufferLevel { |
| 261 | VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000, |
| 262 | VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 263 | } |
| 264 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 265 | enum VkComponentSwizzle { |
| 266 | VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000, |
| 267 | VK_COMPONENT_SWIZZLE_ZERO = 0x00000001, |
| 268 | VK_COMPONENT_SWIZZLE_ONE = 0x00000002, |
| 269 | VK_COMPONENT_SWIZZLE_R = 0x00000003, |
| 270 | VK_COMPONENT_SWIZZLE_G = 0x00000004, |
| 271 | VK_COMPONENT_SWIZZLE_B = 0x00000005, |
| 272 | VK_COMPONENT_SWIZZLE_A = 0x00000006, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | enum VkDescriptorType { |
| 276 | VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000, |
| 277 | VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001, |
| 278 | VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002, |
| 279 | VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003, |
| 280 | VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004, |
| 281 | VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005, |
| 282 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006, |
| 283 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007, |
| 284 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008, |
| 285 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009, |
| 286 | VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a, |
| 287 | } |
| 288 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 289 | enum VkQueryType { |
| 290 | VK_QUERY_TYPE_OCCLUSION = 0x00000000, |
| 291 | VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 292 | VK_QUERY_TYPE_TIMESTAMP = 0x00000002, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 293 | } |
| 294 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 295 | enum VkBorderColor { |
| 296 | VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000, |
| 297 | VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001, |
| 298 | VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002, |
| 299 | VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003, |
| 300 | VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004, |
| 301 | VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005, |
| 302 | } |
| 303 | |
| 304 | enum VkPipelineBindPoint { |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 305 | VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000, |
| 306 | VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 307 | } |
| 308 | |
| 309 | enum VkPrimitiveTopology { |
| 310 | VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000, |
| 311 | VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001, |
| 312 | VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002, |
| 313 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003, |
| 314 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004, |
| 315 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 316 | VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006, |
| 317 | VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007, |
| 318 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008, |
| 319 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009, |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 320 | VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 321 | } |
| 322 | |
| 323 | enum VkSharingMode { |
| 324 | VK_SHARING_MODE_EXCLUSIVE = 0x00000000, |
| 325 | VK_SHARING_MODE_CONCURRENT = 0x00000001, |
| 326 | } |
| 327 | |
| 328 | enum VkIndexType { |
| 329 | VK_INDEX_TYPE_UINT16 = 0x00000000, |
| 330 | VK_INDEX_TYPE_UINT32 = 0x00000001, |
| 331 | } |
| 332 | |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 333 | enum VkFilter { |
| 334 | VK_FILTER_NEAREST = 0x00000000, |
| 335 | VK_FILTER_LINEAR = 0x00000001, |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 336 | |
| 337 | //@extension("VK_IMG_filter_cubic") |
| 338 | VK_FILTER_CUBIC_IMG = 1000015000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 339 | } |
| 340 | |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 341 | enum VkSamplerMipmapMode { |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 342 | VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level |
| 343 | VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 344 | } |
| 345 | |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 346 | enum VkSamplerAddressMode { |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 347 | VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000, |
| 348 | VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001, |
| 349 | VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002, |
| 350 | VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003, |
| 351 | VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 352 | } |
| 353 | |
| 354 | enum VkCompareOp { |
| 355 | VK_COMPARE_OP_NEVER = 0x00000000, |
| 356 | VK_COMPARE_OP_LESS = 0x00000001, |
| 357 | VK_COMPARE_OP_EQUAL = 0x00000002, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 358 | VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 359 | VK_COMPARE_OP_GREATER = 0x00000004, |
| 360 | VK_COMPARE_OP_NOT_EQUAL = 0x00000005, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 361 | VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 362 | VK_COMPARE_OP_ALWAYS = 0x00000007, |
| 363 | } |
| 364 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 365 | enum VkPolygonMode { |
| 366 | VK_POLYGON_MODE_FILL = 0x00000000, |
| 367 | VK_POLYGON_MODE_LINE = 0x00000001, |
| 368 | VK_POLYGON_MODE_POINT = 0x00000002, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 369 | } |
| 370 | |
| 371 | enum VkFrontFace { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 372 | VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000, |
| 373 | VK_FRONT_FACE_CLOCKWISE = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 374 | } |
| 375 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 376 | enum VkBlendFactor { |
| 377 | VK_BLEND_FACTOR_ZERO = 0x00000000, |
| 378 | VK_BLEND_FACTOR_ONE = 0x00000001, |
| 379 | VK_BLEND_FACTOR_SRC_COLOR = 0x00000002, |
| 380 | VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003, |
| 381 | VK_BLEND_FACTOR_DST_COLOR = 0x00000004, |
| 382 | VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005, |
| 383 | VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006, |
| 384 | VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007, |
| 385 | VK_BLEND_FACTOR_DST_ALPHA = 0x00000008, |
| 386 | VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009, |
| 387 | VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a, |
| 388 | VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b, |
| 389 | VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c, |
| 390 | VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d, |
| 391 | VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e, |
| 392 | VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f, |
| 393 | VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010, |
| 394 | VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011, |
| 395 | VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 396 | } |
| 397 | |
| 398 | enum VkBlendOp { |
| 399 | VK_BLEND_OP_ADD = 0x00000000, |
| 400 | VK_BLEND_OP_SUBTRACT = 0x00000001, |
| 401 | VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002, |
| 402 | VK_BLEND_OP_MIN = 0x00000003, |
| 403 | VK_BLEND_OP_MAX = 0x00000004, |
| 404 | } |
| 405 | |
| 406 | enum VkStencilOp { |
| 407 | VK_STENCIL_OP_KEEP = 0x00000000, |
| 408 | VK_STENCIL_OP_ZERO = 0x00000001, |
| 409 | VK_STENCIL_OP_REPLACE = 0x00000002, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 410 | VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003, |
| 411 | VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 412 | VK_STENCIL_OP_INVERT = 0x00000005, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 413 | VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006, |
| 414 | VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 415 | } |
| 416 | |
| 417 | enum VkLogicOp { |
| 418 | VK_LOGIC_OP_CLEAR = 0x00000000, |
| 419 | VK_LOGIC_OP_AND = 0x00000001, |
| 420 | VK_LOGIC_OP_AND_REVERSE = 0x00000002, |
| 421 | VK_LOGIC_OP_COPY = 0x00000003, |
| 422 | VK_LOGIC_OP_AND_INVERTED = 0x00000004, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 423 | VK_LOGIC_OP_NO_OP = 0x00000005, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 424 | VK_LOGIC_OP_XOR = 0x00000006, |
| 425 | VK_LOGIC_OP_OR = 0x00000007, |
| 426 | VK_LOGIC_OP_NOR = 0x00000008, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 427 | VK_LOGIC_OP_EQUIVALENT = 0x00000009, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 428 | VK_LOGIC_OP_INVERT = 0x0000000a, |
| 429 | VK_LOGIC_OP_OR_REVERSE = 0x0000000b, |
| 430 | VK_LOGIC_OP_COPY_INVERTED = 0x0000000c, |
| 431 | VK_LOGIC_OP_OR_INVERTED = 0x0000000d, |
| 432 | VK_LOGIC_OP_NAND = 0x0000000e, |
| 433 | VK_LOGIC_OP_SET = 0x0000000f, |
| 434 | } |
| 435 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 436 | enum VkSystemAllocationScope { |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 437 | VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 438 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001, |
| 439 | VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002, |
| 440 | VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003, |
| 441 | VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 442 | } |
| 443 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 444 | enum VkInternalAllocationType { |
| 445 | VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 446 | } |
| 447 | |
| 448 | enum VkPhysicalDeviceType { |
| 449 | VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000, |
| 450 | VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001, |
| 451 | VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002, |
| 452 | VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003, |
| 453 | VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004, |
| 454 | } |
| 455 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 456 | enum VkVertexInputRate { |
| 457 | VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000, |
| 458 | VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 459 | } |
| 460 | |
| 461 | /// Vulkan format definitions |
| 462 | enum VkFormat { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 463 | VK_FORMAT_UNDEFINED = 0, |
| 464 | VK_FORMAT_R4G4_UNORM_PACK8 = 1, |
| 465 | VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, |
| 466 | VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, |
| 467 | VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, |
| 468 | VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, |
| 469 | VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, |
| 470 | VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, |
| 471 | VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, |
| 472 | VK_FORMAT_R8_UNORM = 9, |
| 473 | VK_FORMAT_R8_SNORM = 10, |
| 474 | VK_FORMAT_R8_USCALED = 11, |
| 475 | VK_FORMAT_R8_SSCALED = 12, |
| 476 | VK_FORMAT_R8_UINT = 13, |
| 477 | VK_FORMAT_R8_SINT = 14, |
| 478 | VK_FORMAT_R8_SRGB = 15, |
| 479 | VK_FORMAT_R8G8_UNORM = 16, |
| 480 | VK_FORMAT_R8G8_SNORM = 17, |
| 481 | VK_FORMAT_R8G8_USCALED = 18, |
| 482 | VK_FORMAT_R8G8_SSCALED = 19, |
| 483 | VK_FORMAT_R8G8_UINT = 20, |
| 484 | VK_FORMAT_R8G8_SINT = 21, |
| 485 | VK_FORMAT_R8G8_SRGB = 22, |
| 486 | VK_FORMAT_R8G8B8_UNORM = 23, |
| 487 | VK_FORMAT_R8G8B8_SNORM = 24, |
| 488 | VK_FORMAT_R8G8B8_USCALED = 25, |
| 489 | VK_FORMAT_R8G8B8_SSCALED = 26, |
| 490 | VK_FORMAT_R8G8B8_UINT = 27, |
| 491 | VK_FORMAT_R8G8B8_SINT = 28, |
| 492 | VK_FORMAT_R8G8B8_SRGB = 29, |
| 493 | VK_FORMAT_B8G8R8_UNORM = 30, |
| 494 | VK_FORMAT_B8G8R8_SNORM = 31, |
| 495 | VK_FORMAT_B8G8R8_USCALED = 32, |
| 496 | VK_FORMAT_B8G8R8_SSCALED = 33, |
| 497 | VK_FORMAT_B8G8R8_UINT = 34, |
| 498 | VK_FORMAT_B8G8R8_SINT = 35, |
| 499 | VK_FORMAT_B8G8R8_SRGB = 36, |
| 500 | VK_FORMAT_R8G8B8A8_UNORM = 37, |
| 501 | VK_FORMAT_R8G8B8A8_SNORM = 38, |
| 502 | VK_FORMAT_R8G8B8A8_USCALED = 39, |
| 503 | VK_FORMAT_R8G8B8A8_SSCALED = 40, |
| 504 | VK_FORMAT_R8G8B8A8_UINT = 41, |
| 505 | VK_FORMAT_R8G8B8A8_SINT = 42, |
| 506 | VK_FORMAT_R8G8B8A8_SRGB = 43, |
| 507 | VK_FORMAT_B8G8R8A8_UNORM = 44, |
| 508 | VK_FORMAT_B8G8R8A8_SNORM = 45, |
| 509 | VK_FORMAT_B8G8R8A8_USCALED = 46, |
| 510 | VK_FORMAT_B8G8R8A8_SSCALED = 47, |
| 511 | VK_FORMAT_B8G8R8A8_UINT = 48, |
| 512 | VK_FORMAT_B8G8R8A8_SINT = 49, |
| 513 | VK_FORMAT_B8G8R8A8_SRGB = 50, |
| 514 | VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, |
| 515 | VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, |
| 516 | VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, |
| 517 | VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, |
| 518 | VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, |
| 519 | VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, |
| 520 | VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, |
| 521 | VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, |
| 522 | VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, |
| 523 | VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, |
| 524 | VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, |
| 525 | VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, |
| 526 | VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, |
| 527 | VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, |
| 528 | VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, |
| 529 | VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, |
| 530 | VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, |
| 531 | VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, |
| 532 | VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, |
| 533 | VK_FORMAT_R16_UNORM = 70, |
| 534 | VK_FORMAT_R16_SNORM = 71, |
| 535 | VK_FORMAT_R16_USCALED = 72, |
| 536 | VK_FORMAT_R16_SSCALED = 73, |
| 537 | VK_FORMAT_R16_UINT = 74, |
| 538 | VK_FORMAT_R16_SINT = 75, |
| 539 | VK_FORMAT_R16_SFLOAT = 76, |
| 540 | VK_FORMAT_R16G16_UNORM = 77, |
| 541 | VK_FORMAT_R16G16_SNORM = 78, |
| 542 | VK_FORMAT_R16G16_USCALED = 79, |
| 543 | VK_FORMAT_R16G16_SSCALED = 80, |
| 544 | VK_FORMAT_R16G16_UINT = 81, |
| 545 | VK_FORMAT_R16G16_SINT = 82, |
| 546 | VK_FORMAT_R16G16_SFLOAT = 83, |
| 547 | VK_FORMAT_R16G16B16_UNORM = 84, |
| 548 | VK_FORMAT_R16G16B16_SNORM = 85, |
| 549 | VK_FORMAT_R16G16B16_USCALED = 86, |
| 550 | VK_FORMAT_R16G16B16_SSCALED = 87, |
| 551 | VK_FORMAT_R16G16B16_UINT = 88, |
| 552 | VK_FORMAT_R16G16B16_SINT = 89, |
| 553 | VK_FORMAT_R16G16B16_SFLOAT = 90, |
| 554 | VK_FORMAT_R16G16B16A16_UNORM = 91, |
| 555 | VK_FORMAT_R16G16B16A16_SNORM = 92, |
| 556 | VK_FORMAT_R16G16B16A16_USCALED = 93, |
| 557 | VK_FORMAT_R16G16B16A16_SSCALED = 94, |
| 558 | VK_FORMAT_R16G16B16A16_UINT = 95, |
| 559 | VK_FORMAT_R16G16B16A16_SINT = 96, |
| 560 | VK_FORMAT_R16G16B16A16_SFLOAT = 97, |
| 561 | VK_FORMAT_R32_UINT = 98, |
| 562 | VK_FORMAT_R32_SINT = 99, |
| 563 | VK_FORMAT_R32_SFLOAT = 100, |
| 564 | VK_FORMAT_R32G32_UINT = 101, |
| 565 | VK_FORMAT_R32G32_SINT = 102, |
| 566 | VK_FORMAT_R32G32_SFLOAT = 103, |
| 567 | VK_FORMAT_R32G32B32_UINT = 104, |
| 568 | VK_FORMAT_R32G32B32_SINT = 105, |
| 569 | VK_FORMAT_R32G32B32_SFLOAT = 106, |
| 570 | VK_FORMAT_R32G32B32A32_UINT = 107, |
| 571 | VK_FORMAT_R32G32B32A32_SINT = 108, |
| 572 | VK_FORMAT_R32G32B32A32_SFLOAT = 109, |
| 573 | VK_FORMAT_R64_UINT = 110, |
| 574 | VK_FORMAT_R64_SINT = 111, |
| 575 | VK_FORMAT_R64_SFLOAT = 112, |
| 576 | VK_FORMAT_R64G64_UINT = 113, |
| 577 | VK_FORMAT_R64G64_SINT = 114, |
| 578 | VK_FORMAT_R64G64_SFLOAT = 115, |
| 579 | VK_FORMAT_R64G64B64_UINT = 116, |
| 580 | VK_FORMAT_R64G64B64_SINT = 117, |
| 581 | VK_FORMAT_R64G64B64_SFLOAT = 118, |
| 582 | VK_FORMAT_R64G64B64A64_UINT = 119, |
| 583 | VK_FORMAT_R64G64B64A64_SINT = 120, |
| 584 | VK_FORMAT_R64G64B64A64_SFLOAT = 121, |
| 585 | VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, |
| 586 | VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, |
| 587 | VK_FORMAT_D16_UNORM = 124, |
| 588 | VK_FORMAT_X8_D24_UNORM_PACK32 = 125, |
| 589 | VK_FORMAT_D32_SFLOAT = 126, |
| 590 | VK_FORMAT_S8_UINT = 127, |
| 591 | VK_FORMAT_D16_UNORM_S8_UINT = 128, |
| 592 | VK_FORMAT_D24_UNORM_S8_UINT = 129, |
| 593 | VK_FORMAT_D32_SFLOAT_S8_UINT = 130, |
| 594 | VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, |
| 595 | VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, |
| 596 | VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, |
| 597 | VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, |
| 598 | VK_FORMAT_BC2_UNORM_BLOCK = 135, |
| 599 | VK_FORMAT_BC2_SRGB_BLOCK = 136, |
| 600 | VK_FORMAT_BC3_UNORM_BLOCK = 137, |
| 601 | VK_FORMAT_BC3_SRGB_BLOCK = 138, |
| 602 | VK_FORMAT_BC4_UNORM_BLOCK = 139, |
| 603 | VK_FORMAT_BC4_SNORM_BLOCK = 140, |
| 604 | VK_FORMAT_BC5_UNORM_BLOCK = 141, |
| 605 | VK_FORMAT_BC5_SNORM_BLOCK = 142, |
| 606 | VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, |
| 607 | VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, |
| 608 | VK_FORMAT_BC7_UNORM_BLOCK = 145, |
| 609 | VK_FORMAT_BC7_SRGB_BLOCK = 146, |
| 610 | VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, |
| 611 | VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, |
| 612 | VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, |
| 613 | VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, |
| 614 | VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, |
| 615 | VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, |
| 616 | VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, |
| 617 | VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, |
| 618 | VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, |
| 619 | VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, |
| 620 | VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, |
| 621 | VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, |
| 622 | VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, |
| 623 | VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, |
| 624 | VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, |
| 625 | VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, |
| 626 | VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, |
| 627 | VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, |
| 628 | VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, |
| 629 | VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, |
| 630 | VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, |
| 631 | VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, |
| 632 | VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, |
| 633 | VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, |
| 634 | VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, |
| 635 | VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, |
| 636 | VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, |
| 637 | VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, |
| 638 | VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, |
| 639 | VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, |
| 640 | VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, |
| 641 | VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, |
| 642 | VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, |
| 643 | VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, |
| 644 | VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, |
| 645 | VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, |
| 646 | VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, |
| 647 | VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 648 | |
| 649 | //@extension("VK_IMG_format_pvrtc") |
| 650 | VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, |
| 651 | |
| 652 | //@extension("VK_IMG_format_pvrtc") |
| 653 | VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, |
| 654 | |
| 655 | //@extension("VK_IMG_format_pvrtc") |
| 656 | VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, |
| 657 | |
| 658 | //@extension("VK_IMG_format_pvrtc") |
| 659 | VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, |
| 660 | |
| 661 | //@extension("VK_IMG_format_pvrtc") |
| 662 | VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, |
| 663 | |
| 664 | //@extension("VK_IMG_format_pvrtc") |
| 665 | VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, |
| 666 | |
| 667 | //@extension("VK_IMG_format_pvrtc") |
| 668 | VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, |
| 669 | |
| 670 | //@extension("VK_IMG_format_pvrtc") |
| 671 | VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 672 | } |
| 673 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 674 | /// Structure type enumerant |
| 675 | enum VkStructureType { |
| 676 | VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 677 | VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, |
| 678 | VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, |
| 679 | VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, |
| 680 | VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 681 | VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 682 | VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, |
| 683 | VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, |
| 684 | VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, |
| 685 | VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 686 | VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 687 | VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, |
| 688 | VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, |
| 689 | VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, |
| 690 | VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, |
| 691 | VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, |
| 692 | VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 693 | VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, |
| 694 | VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, |
| 695 | VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, |
| 696 | VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, |
| 697 | VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, |
| 698 | VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, |
| 699 | VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, |
| 700 | VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, |
| 701 | VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, |
| 702 | VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, |
| 703 | VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, |
| 704 | VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, |
| 705 | VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, |
| 706 | VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, |
| 707 | VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, |
| 708 | VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, |
| 709 | VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 710 | VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 711 | VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, |
| 712 | VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, |
| 713 | VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, |
| 714 | VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, |
| 715 | VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 716 | VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 717 | VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, |
| 718 | VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, |
| 719 | VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, |
| 720 | VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, |
| 721 | VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, |
| 722 | VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, |
| 723 | VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, |
| 724 | VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 725 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 726 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 727 | VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, |
| 728 | VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 729 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 730 | //@extension("VK_KHR_display") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 731 | VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000, |
| 732 | VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 733 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 734 | //@extension("VK_KHR_display_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 735 | VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 736 | |
| 737 | //@extension("VK_KHR_xlib_surface") |
| 738 | VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, |
| 739 | |
| 740 | //@extension("VK_KHR_xcb_surface") |
| 741 | VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, |
| 742 | |
| 743 | //@extension("VK_KHR_wayland_surface") |
| 744 | VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, |
| 745 | |
| 746 | //@extension("VK_KHR_mir_surface") |
| 747 | VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, |
| 748 | |
| 749 | //@extension("VK_KHR_android_surface") |
| 750 | VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, |
| 751 | |
| 752 | //@extension("VK_KHR_win32_surface") |
| 753 | VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 754 | |
Ian Elliott | 948233a | 2017-01-06 12:13:23 -0700 | [diff] [blame] | 755 | //@extension("VK_KHR_incremental_present") |
| 756 | VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, |
| 757 | |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 758 | //@extension("VK_ANDROID_native_buffer") |
| 759 | VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000, |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 760 | VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001, |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 761 | |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 762 | //@extension("VK_GOOGLE_display_timing") |
Ian Elliott | 14866bb | 2017-01-20 09:15:48 -0700 | [diff] [blame] | 763 | VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000, |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 764 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 765 | //@extension("VK_EXT_debug_report") |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 766 | VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, |
| 767 | |
| 768 | //@extension("VK_AMD_rasterization_order") |
| 769 | VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, |
| 770 | |
| 771 | //@extension("VK_EXT_debug_marker") |
| 772 | VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, |
| 773 | |
| 774 | //@extension("VK_EXT_debug_marker") |
| 775 | VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, |
| 776 | |
| 777 | //@extension("VK_EXT_debug_marker") |
| 778 | VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 779 | |
| 780 | //@extension("VK_NV_dedicated_allocation") |
| 781 | VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, |
| 782 | |
| 783 | //@extension("VK_NV_dedicated_allocation") |
| 784 | VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, |
| 785 | |
| 786 | //@extension("VK_NV_dedicated_allocation") |
| 787 | VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 788 | |
| 789 | //@extension("VK_NV_external_memory") |
| 790 | VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, |
| 791 | |
| 792 | //@extension("VK_NV_external_memory") |
| 793 | VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, |
| 794 | |
| 795 | //@extension("VK_NV_external_memory_win32") |
| 796 | VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000, |
| 797 | |
| 798 | //@extension("VK_NV_external_memory_win32") |
| 799 | VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001, |
| 800 | |
| 801 | //@extension("VK_NV_win32_keyed_mutex") |
| 802 | VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000, |
| 803 | |
Chris Forbes | 1194ede | 2016-12-30 16:29:25 +1300 | [diff] [blame] | 804 | //@extension("VK_KHR_get_physical_device_properties2") |
| 805 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000, |
| 806 | |
| 807 | //@extension("VK_KHR_get_physical_device_properties2") |
| 808 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001, |
| 809 | |
| 810 | //@extension("VK_KHR_get_physical_device_properties2") |
| 811 | VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002, |
| 812 | |
| 813 | //@extension("VK_KHR_get_physical_device_properties2") |
| 814 | VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003, |
| 815 | |
| 816 | //@extension("VK_KHR_get_physical_device_properties2") |
| 817 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004, |
| 818 | |
| 819 | //@extension("VK_KHR_get_physical_device_properties2") |
| 820 | VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005, |
| 821 | |
| 822 | //@extension("VK_KHR_get_physical_device_properties2") |
| 823 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006, |
| 824 | |
| 825 | //@extension("VK_KHR_get_physical_device_properties2") |
| 826 | VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007, |
| 827 | |
| 828 | //@extension("VK_KHR_get_physical_device_properties2") |
| 829 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008, |
| 830 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 831 | //@extension("VK_EXT_validation_flags") |
| 832 | VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, |
| 833 | |
| 834 | //@extension("VK_KHR_incremental_present") |
| 835 | VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, |
| 836 | |
| 837 | //@extension("VK_NVX_device_generated_commands") |
| 838 | VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, |
| 839 | |
| 840 | //@extension("VK_NVX_device_generated_commands") |
| 841 | VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, |
| 842 | |
| 843 | //@extension("VK_NVX_device_generated_commands") |
| 844 | VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002, |
| 845 | |
| 846 | //@extension("VK_NVX_device_generated_commands") |
| 847 | VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003, |
| 848 | |
| 849 | //@extension("VK_NVX_device_generated_commands") |
| 850 | VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004, |
| 851 | |
| 852 | //@extension("VK_NVX_device_generated_commands") |
| 853 | VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 854 | } |
| 855 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 856 | enum VkSubpassContents { |
| 857 | VK_SUBPASS_CONTENTS_INLINE = 0x00000000, |
| 858 | VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 859 | } |
| 860 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 861 | enum VkPipelineCacheHeaderVersion { |
| 862 | VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, |
| 863 | } |
| 864 | |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 865 | @lastUnused(-11) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 866 | /// Error and return codes |
| 867 | enum VkResult { |
| 868 | // Return codes for successful operation execution (positive values) |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 869 | VK_SUCCESS = 0, |
| 870 | VK_NOT_READY = 1, |
| 871 | VK_TIMEOUT = 2, |
| 872 | VK_EVENT_SET = 3, |
| 873 | VK_EVENT_RESET = 4, |
| 874 | VK_INCOMPLETE = 5, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 875 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 876 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 877 | VK_SUBOPTIMAL_KHR = 1000001003, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 878 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 879 | // Error codes (negative values) |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 880 | VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1 |
| 881 | VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2 |
| 882 | VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3 |
| 883 | VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4 |
| 884 | VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5 |
| 885 | VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6 |
| 886 | VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7 |
| 887 | VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8 |
| 888 | VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9 |
| 889 | VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10 |
| 890 | VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11 |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 891 | VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12 |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 892 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 893 | //@extension("VK_KHR_surface") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 894 | VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000 |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 895 | |
Jesse Hall | 563380d | 2016-01-15 23:14:05 -0800 | [diff] [blame] | 896 | //@extension("VK_KHR_surface") |
| 897 | VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001 |
| 898 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 899 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 900 | VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004 |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 901 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 902 | //@extension("VK_KHR_display_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 903 | VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001 |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 904 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 905 | //@extension("VK_EXT_debug_report") |
| 906 | VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001 |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 907 | |
| 908 | //@extension("VK_NV_glsl_shader") |
| 909 | VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000 |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 910 | } |
| 911 | |
| 912 | enum VkDynamicState { |
| 913 | VK_DYNAMIC_STATE_VIEWPORT = 0x00000000, |
| 914 | VK_DYNAMIC_STATE_SCISSOR = 0x00000001, |
| 915 | VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002, |
| 916 | VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003, |
| 917 | VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004, |
| 918 | VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005, |
| 919 | VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006, |
| 920 | VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007, |
| 921 | VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 922 | } |
| 923 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 924 | @extension("VK_KHR_surface") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 925 | enum VkPresentModeKHR { |
| 926 | VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000, |
| 927 | VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001, |
| 928 | VK_PRESENT_MODE_FIFO_KHR = 0x00000002, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 929 | VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003, |
Chris Forbes | 1d5f68c | 2017-01-31 10:17:01 +1300 | [diff] [blame] | 930 | //@extension("VK_KHR_shared_presentable_image") |
| 931 | VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000, |
| 932 | //@extension("VK_KHR_shared_presentable_image") |
| 933 | VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 934 | } |
| 935 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 936 | @extension("VK_KHR_surface") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 937 | enum VkColorSpaceKHR { |
| 938 | VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000, |
Courtney Goeltzenleuchter | 7f558ed | 2017-01-23 17:15:24 -0700 | [diff] [blame] | 939 | VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104001, |
| 940 | VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104002, |
| 941 | VK_COLOR_SPACE_SCRGB_LINEAR_EXT = 1000104003, |
| 942 | VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT = 1000104004, |
| 943 | VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104005, |
| 944 | VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104006, |
| 945 | VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104007, |
| 946 | VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104008, |
| 947 | VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104009, |
| 948 | VK_COLOR_SPACE_BT2020_NONLINEAR_EXT = 1000104010, |
| 949 | VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, |
| 950 | VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 951 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 952 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 953 | @extension("VK_EXT_debug_report") |
| 954 | enum VkDebugReportObjectTypeEXT { |
| 955 | VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, |
| 956 | VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, |
| 957 | VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, |
| 958 | VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, |
| 959 | VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, |
| 960 | VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, |
| 961 | VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, |
| 962 | VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, |
| 963 | VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, |
| 964 | VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, |
| 965 | VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, |
| 966 | VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, |
| 967 | VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, |
| 968 | VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, |
| 969 | VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, |
| 970 | VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, |
| 971 | VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, |
| 972 | VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, |
| 973 | VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, |
| 974 | VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, |
| 975 | VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, |
| 976 | VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, |
| 977 | VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, |
| 978 | VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, |
| 979 | VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, |
| 980 | VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, |
| 981 | VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, |
| 982 | VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, |
| 983 | VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28, |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 984 | VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, |
| 985 | VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, |
| 986 | VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31, |
| 987 | VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32, |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 988 | } |
| 989 | |
| 990 | @extension("VK_EXT_debug_report") |
| 991 | enum VkDebugReportErrorEXT { |
| 992 | VK_DEBUG_REPORT_ERROR_NONE_EXT = 0, |
| 993 | VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1, |
| 994 | } |
| 995 | |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 996 | @extension("VK_AMD_rasterization_order") |
| 997 | enum VkRasterizationOrderAMD { |
| 998 | VK_RASTERIZATION_ORDER_STRICT_AMD = 0, |
| 999 | VK_RASTERIZATION_ORDER_RELAXED_AMD = 1, |
| 1000 | } |
| 1001 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 1002 | @extension("VK_EXT_validation_flags") |
| 1003 | enum VkValidationCheckEXT { |
| 1004 | VK_VALIDATION_CHECK_ALL_EXT = 0, |
| 1005 | } |
| 1006 | |
| 1007 | @extension("VK_NVX_device_generated_commands") |
| 1008 | enum VkIndirectCommandsTokenTypeNVX { |
| 1009 | VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0, |
| 1010 | VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1, |
| 1011 | VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2, |
| 1012 | VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3, |
| 1013 | VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4, |
| 1014 | VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5, |
| 1015 | VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6, |
| 1016 | VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7, |
| 1017 | } |
| 1018 | |
| 1019 | @extension("VK_NVX_device_generated_commands") |
| 1020 | enum VkObjectEntryTypeNVX { |
| 1021 | VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0, |
| 1022 | VK_OBJECT_ENTRY_PIPELINE_NVX = 1, |
| 1023 | VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2, |
| 1024 | VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3, |
| 1025 | VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4, |
| 1026 | } |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 1027 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1028 | ///////////////// |
| 1029 | // Bitfields // |
| 1030 | ///////////////// |
| 1031 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1032 | /// Queue capabilities |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1033 | type VkFlags VkQueueFlags |
| 1034 | bitfield VkQueueFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1035 | VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations |
| 1036 | VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1037 | VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1038 | VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1039 | } |
| 1040 | |
| 1041 | /// Memory properties passed into vkAllocMemory(). |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1042 | type VkFlags VkMemoryPropertyFlags |
| 1043 | bitfield VkMemoryPropertyFlagBits { |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 1044 | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, |
| 1045 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, |
| 1046 | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, |
| 1047 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, |
| 1048 | VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1049 | } |
| 1050 | |
| 1051 | /// Memory heap flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1052 | type VkFlags VkMemoryHeapFlags |
| 1053 | bitfield VkMemoryHeapFlagBits { |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 1054 | VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1055 | } |
| 1056 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1057 | /// Access flags |
| 1058 | type VkFlags VkAccessFlags |
| 1059 | bitfield VkAccessFlagBits { |
| 1060 | VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, |
| 1061 | VK_ACCESS_INDEX_READ_BIT = 0x00000002, |
| 1062 | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, |
| 1063 | VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, |
| 1064 | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, |
| 1065 | VK_ACCESS_SHADER_READ_BIT = 0x00000020, |
| 1066 | VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, |
| 1067 | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, |
| 1068 | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, |
| 1069 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, |
| 1070 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, |
| 1071 | VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, |
| 1072 | VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, |
| 1073 | VK_ACCESS_HOST_READ_BIT = 0x00002000, |
| 1074 | VK_ACCESS_HOST_WRITE_BIT = 0x00004000, |
| 1075 | VK_ACCESS_MEMORY_READ_BIT = 0x00008000, |
| 1076 | VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 1077 | |
| 1078 | //@extension("VK_NVX_device_generated_commands") |
| 1079 | VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000, |
| 1080 | |
| 1081 | //@extension("VK_NVX_device_generated_commands") |
| 1082 | VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1083 | } |
| 1084 | |
| 1085 | /// Buffer usage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1086 | type VkFlags VkBufferUsageFlags |
| 1087 | bitfield VkBufferUsageFlagBits { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1088 | VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations |
| 1089 | VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1090 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO |
| 1091 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO |
| 1092 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO |
| 1093 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO |
| 1094 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer) |
| 1095 | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO) |
| 1096 | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer) |
| 1097 | } |
| 1098 | |
| 1099 | /// Buffer creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1100 | type VkFlags VkBufferCreateFlags |
| 1101 | bitfield VkBufferCreateFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1102 | VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1103 | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency |
| 1104 | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers |
| 1105 | } |
| 1106 | |
| 1107 | /// Shader stage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1108 | type VkFlags VkShaderStageFlags |
| 1109 | bitfield VkShaderStageFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1110 | VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1111 | VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, |
| 1112 | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1113 | VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, |
| 1114 | VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, |
| 1115 | VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 1116 | VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1117 | |
| 1118 | VK_SHADER_STAGE_ALL = 0x7FFFFFFF, |
| 1119 | } |
| 1120 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1121 | /// Descriptor pool create flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1122 | type VkFlags VkDescriptorPoolCreateFlags |
| 1123 | bitfield VkDescriptorPoolCreateFlagBits { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1124 | VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, |
| 1125 | } |
| 1126 | |
| 1127 | /// Descriptor pool reset flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1128 | type VkFlags VkDescriptorPoolResetFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1129 | //bitfield VkDescriptorPoolResetFlagBits { |
| 1130 | //} |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1131 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1132 | /// Image usage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1133 | type VkFlags VkImageUsageFlags |
| 1134 | bitfield VkImageUsageFlagBits { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1135 | VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations |
| 1136 | VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1137 | VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types) |
| 1138 | VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type) |
| 1139 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1140 | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1141 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering |
| 1142 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment |
| 1143 | } |
| 1144 | |
| 1145 | /// Image creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1146 | type VkFlags VkImageCreateFlags |
| 1147 | bitfield VkImageCreateFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1148 | VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1149 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency |
| 1150 | 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 Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1151 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image |
| 1152 | VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, /// Allows creating image views with cube type from the created image |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1153 | } |
| 1154 | |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1155 | /// Image view creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1156 | type VkFlags VkImageViewCreateFlags |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1157 | //bitfield VkImageViewCreateFlagBits { |
| 1158 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1159 | |
| 1160 | /// Pipeline creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1161 | type VkFlags VkPipelineCreateFlags |
| 1162 | bitfield VkPipelineCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1163 | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, |
| 1164 | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, |
| 1165 | VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, |
| 1166 | } |
| 1167 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1168 | /// Color component flags |
| 1169 | type VkFlags VkColorComponentFlags |
| 1170 | bitfield VkColorComponentFlagBits { |
| 1171 | VK_COLOR_COMPONENT_R_BIT = 0x00000001, |
| 1172 | VK_COLOR_COMPONENT_G_BIT = 0x00000002, |
| 1173 | VK_COLOR_COMPONENT_B_BIT = 0x00000004, |
| 1174 | VK_COLOR_COMPONENT_A_BIT = 0x00000008, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1175 | } |
| 1176 | |
| 1177 | /// Fence creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1178 | type VkFlags VkFenceCreateFlags |
| 1179 | bitfield VkFenceCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1180 | VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, |
| 1181 | } |
| 1182 | |
| 1183 | /// Semaphore creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1184 | type VkFlags VkSemaphoreCreateFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1185 | //bitfield VkSemaphoreCreateFlagBits { |
| 1186 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1187 | |
| 1188 | /// Format capability flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1189 | type VkFlags VkFormatFeatureFlags |
| 1190 | bitfield VkFormatFeatureFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1191 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types) |
| 1192 | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type) |
| 1193 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images |
| 1194 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs) |
| 1195 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs) |
| 1196 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers |
| 1197 | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs) |
| 1198 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images |
| 1199 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images |
| 1200 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1201 | VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage |
| 1202 | VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCommandBlitImage |
Jesse Hall | 33faaad | 2016-01-24 21:00:49 -0800 | [diff] [blame] | 1203 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 1204 | |
| 1205 | //@extension("VK_IMG_filter_cubic") |
| 1206 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1207 | } |
| 1208 | |
| 1209 | /// Query control flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1210 | type VkFlags VkQueryControlFlags |
| 1211 | bitfield VkQueryControlFlagBits { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1212 | VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1213 | } |
| 1214 | |
| 1215 | /// Query result flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1216 | type VkFlags VkQueryResultFlags |
| 1217 | bitfield VkQueryResultFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1218 | VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values |
| 1219 | VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy |
| 1220 | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written |
| 1221 | VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available |
| 1222 | } |
| 1223 | |
| 1224 | /// Shader module creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1225 | type VkFlags VkShaderModuleCreateFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1226 | //bitfield VkShaderModuleCreateFlagBits { |
| 1227 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1228 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1229 | /// Event creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1230 | type VkFlags VkEventCreateFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1231 | //bitfield VkEventCreateFlagBits { |
| 1232 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1233 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1234 | /// Command buffer usage flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1235 | type VkFlags VkCommandBufferUsageFlags |
| 1236 | bitfield VkCommandBufferUsageFlagBits { |
| 1237 | VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, |
| 1238 | VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, |
| 1239 | VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1240 | } |
| 1241 | |
| 1242 | /// Pipeline statistics flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1243 | type VkFlags VkQueryPipelineStatisticFlags |
| 1244 | bitfield VkQueryPipelineStatisticFlagBits { |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1245 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional |
| 1246 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional |
| 1247 | VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional |
| 1248 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional |
| 1249 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional |
| 1250 | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional |
| 1251 | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional |
| 1252 | VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional |
| 1253 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional |
| 1254 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional |
| 1255 | VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1256 | } |
| 1257 | |
| 1258 | /// Memory mapping flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1259 | type VkFlags VkMemoryMapFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1260 | //bitfield VkMemoryMapFlagBits { |
| 1261 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1262 | |
| 1263 | /// Bitfield of image aspects |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1264 | type VkFlags VkImageAspectFlags |
| 1265 | bitfield VkImageAspectFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1266 | VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, |
| 1267 | VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, |
| 1268 | VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, |
| 1269 | VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, |
| 1270 | } |
| 1271 | |
| 1272 | /// Sparse memory bind flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1273 | type VkFlags VkSparseMemoryBindFlags |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 1274 | bitfield VkSparseMemoryBindFlagBits { |
| 1275 | VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001, |
| 1276 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1277 | |
| 1278 | /// Sparse image memory requirements flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1279 | type VkFlags VkSparseImageFormatFlags |
| 1280 | bitfield VkSparseImageFormatFlagBits { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1281 | VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices |
| 1282 | 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. |
| 1283 | VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1284 | } |
| 1285 | |
| 1286 | /// Pipeline stages |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1287 | type VkFlags VkPipelineStageFlags |
| 1288 | bitfield VkPipelineStageFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1289 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed |
| 1290 | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch |
| 1291 | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch |
| 1292 | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1293 | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading |
| 1294 | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1295 | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading |
| 1296 | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading |
| 1297 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests |
| 1298 | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests |
| 1299 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes |
| 1300 | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading |
| 1301 | VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 1302 | VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, |
| 1303 | VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1304 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 1305 | VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline |
| 1306 | VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 1307 | |
| 1308 | //@extension("VK_NVX_device_generated_commands") |
| 1309 | VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1310 | } |
| 1311 | |
| 1312 | /// Render pass attachment description flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1313 | type VkFlags VkAttachmentDescriptionFlags |
| 1314 | bitfield VkAttachmentDescriptionFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1315 | VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001, /// The attachment may alias physical memory of another attachment in the same renderpass |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1316 | } |
| 1317 | |
| 1318 | /// Subpass description flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1319 | type VkFlags VkSubpassDescriptionFlags |
| 1320 | bitfield VkSubpassDescriptionFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1321 | } |
| 1322 | |
| 1323 | /// Command pool creation flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1324 | type VkFlags VkCommandPoolCreateFlags |
| 1325 | bitfield VkCommandPoolCreateFlagBits { |
| 1326 | VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime |
| 1327 | VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1328 | } |
| 1329 | |
| 1330 | /// Command pool reset flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1331 | type VkFlags VkCommandPoolResetFlags |
| 1332 | bitfield VkCommandPoolResetFlagBits { |
| 1333 | VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1334 | } |
| 1335 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1336 | type VkFlags VkCommandBufferResetFlags |
| 1337 | bitfield VkCommandBufferResetFlagBits { |
| 1338 | VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1339 | } |
| 1340 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1341 | type VkFlags VkSampleCountFlags |
| 1342 | bitfield VkSampleCountFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1343 | VK_SAMPLE_COUNT_1_BIT = 0x00000001, |
| 1344 | VK_SAMPLE_COUNT_2_BIT = 0x00000002, |
| 1345 | VK_SAMPLE_COUNT_4_BIT = 0x00000004, |
| 1346 | VK_SAMPLE_COUNT_8_BIT = 0x00000008, |
| 1347 | VK_SAMPLE_COUNT_16_BIT = 0x00000010, |
| 1348 | VK_SAMPLE_COUNT_32_BIT = 0x00000020, |
| 1349 | VK_SAMPLE_COUNT_64_BIT = 0x00000040, |
| 1350 | } |
| 1351 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1352 | type VkFlags VkStencilFaceFlags |
| 1353 | bitfield VkStencilFaceFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1354 | VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face |
| 1355 | VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 1356 | VK_STENCIL_FRONT_AND_BACK = 0x00000003, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1357 | } |
| 1358 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1359 | /// Instance creation flags |
| 1360 | type VkFlags VkInstanceCreateFlags |
| 1361 | //bitfield VkInstanceCreateFlagBits { |
| 1362 | //} |
| 1363 | |
| 1364 | /// Device creation flags |
| 1365 | type VkFlags VkDeviceCreateFlags |
| 1366 | //bitfield VkDeviceCreateFlagBits { |
| 1367 | //} |
| 1368 | |
| 1369 | /// Device queue creation flags |
| 1370 | type VkFlags VkDeviceQueueCreateFlags |
| 1371 | //bitfield VkDeviceQueueCreateFlagBits { |
| 1372 | //} |
| 1373 | |
| 1374 | /// Query pool creation flags |
| 1375 | type VkFlags VkQueryPoolCreateFlags |
| 1376 | //bitfield VkQueryPoolCreateFlagBits { |
| 1377 | //} |
| 1378 | |
| 1379 | /// Buffer view creation flags |
| 1380 | type VkFlags VkBufferViewCreateFlags |
| 1381 | //bitfield VkBufferViewCreateFlagBits { |
| 1382 | //} |
| 1383 | |
| 1384 | /// Pipeline cache creation flags |
| 1385 | type VkFlags VkPipelineCacheCreateFlags |
| 1386 | //bitfield VkPipelineCacheCreateFlagBits { |
| 1387 | //} |
| 1388 | |
| 1389 | /// Pipeline shader stage creation flags |
| 1390 | type VkFlags VkPipelineShaderStageCreateFlags |
| 1391 | //bitfield VkPipelineShaderStageCreateFlagBits { |
| 1392 | //} |
| 1393 | |
| 1394 | /// Descriptor set layout creation flags |
| 1395 | type VkFlags VkDescriptorSetLayoutCreateFlags |
| 1396 | //bitfield VkDescriptorSetLayoutCreateFlagBits { |
| 1397 | //} |
| 1398 | |
| 1399 | /// Pipeline vertex input state creation flags |
| 1400 | type VkFlags VkPipelineVertexInputStateCreateFlags |
| 1401 | //bitfield VkPipelineVertexInputStateCreateFlagBits { |
| 1402 | //} |
| 1403 | |
| 1404 | /// Pipeline input assembly state creation flags |
| 1405 | type VkFlags VkPipelineInputAssemblyStateCreateFlags |
| 1406 | //bitfield VkPipelineInputAssemblyStateCreateFlagBits { |
| 1407 | //} |
| 1408 | |
| 1409 | /// Tessellation state creation flags |
| 1410 | type VkFlags VkPipelineTessellationStateCreateFlags |
| 1411 | //bitfield VkPipelineTessellationStateCreateFlagBits { |
| 1412 | //} |
| 1413 | |
| 1414 | /// Viewport state creation flags |
| 1415 | type VkFlags VkPipelineViewportStateCreateFlags |
| 1416 | //bitfield VkPipelineViewportStateCreateFlagBits { |
| 1417 | //} |
| 1418 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1419 | /// Rasterization state creation flags |
| 1420 | type VkFlags VkPipelineRasterizationStateCreateFlags |
| 1421 | //bitfield VkPipelineRasterizationStateCreateFlagBits { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1422 | //} |
| 1423 | |
| 1424 | /// Multisample state creation flags |
| 1425 | type VkFlags VkPipelineMultisampleStateCreateFlags |
| 1426 | //bitfield VkPipelineMultisampleStateCreateFlagBits { |
| 1427 | //} |
| 1428 | |
| 1429 | /// Color blend state creation flags |
| 1430 | type VkFlags VkPipelineColorBlendStateCreateFlags |
| 1431 | //bitfield VkPipelineColorBlendStateCreateFlagBits { |
| 1432 | //} |
| 1433 | |
| 1434 | /// Depth/stencil state creation flags |
| 1435 | type VkFlags VkPipelineDepthStencilStateCreateFlags |
| 1436 | //bitfield VkPipelineDepthStencilStateCreateFlagBits { |
| 1437 | //} |
| 1438 | |
| 1439 | /// Dynamic state creation flags |
| 1440 | type VkFlags VkPipelineDynamicStateCreateFlags |
| 1441 | //bitfield VkPipelineDynamicStateCreateFlagBits { |
| 1442 | //} |
| 1443 | |
| 1444 | /// Pipeline layout creation flags |
| 1445 | type VkFlags VkPipelineLayoutCreateFlags |
| 1446 | //bitfield VkPipelineLayoutCreateFlagBits { |
| 1447 | //} |
| 1448 | |
| 1449 | /// Sampler creation flags |
| 1450 | type VkFlags VkSamplerCreateFlags |
| 1451 | //bitfield VkSamplerCreateFlagBits { |
| 1452 | //} |
| 1453 | |
| 1454 | /// Render pass creation flags |
| 1455 | type VkFlags VkRenderPassCreateFlags |
| 1456 | //bitfield VkRenderPassCreateFlagBits { |
| 1457 | //} |
| 1458 | |
| 1459 | /// Framebuffer creation flags |
| 1460 | type VkFlags VkFramebufferCreateFlags |
| 1461 | //bitfield VkFramebufferCreateFlagBits { |
| 1462 | //} |
| 1463 | |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 1464 | /// Dependency flags |
| 1465 | type VkFlags VkDependencyFlags |
| 1466 | bitfield VkDependencyFlagBits { |
| 1467 | VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, |
| 1468 | } |
| 1469 | |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 1470 | /// Cull mode flags |
| 1471 | type VkFlags VkCullModeFlags |
| 1472 | bitfield VkCullModeFlagBits { |
| 1473 | VK_CULL_MODE_NONE = 0x00000000, |
| 1474 | VK_CULL_MODE_FRONT_BIT = 0x00000001, |
| 1475 | VK_CULL_MODE_BACK_BIT = 0x00000002, |
| 1476 | VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, |
| 1477 | } |
| 1478 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1479 | @extension("VK_KHR_surface") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1480 | type VkFlags VkSurfaceTransformFlagsKHR |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1481 | @extension("VK_KHR_surface") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1482 | bitfield VkSurfaceTransformFlagBitsKHR { |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1483 | VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 1484 | VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, |
| 1485 | VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, |
| 1486 | VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, |
| 1487 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, |
| 1488 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, |
| 1489 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, |
| 1490 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, |
| 1491 | VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 1492 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1493 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1494 | @extension("VK_KHR_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1495 | type VkFlags VkCompositeAlphaFlagsKHR |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1496 | @extension("VK_KHR_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1497 | bitfield VkCompositeAlphaFlagBitsKHR { |
| 1498 | VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, |
| 1499 | VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, |
| 1500 | VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, |
| 1501 | VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, |
| 1502 | } |
| 1503 | |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1504 | @extension("VK_KHR_swapchain") |
| 1505 | type VkFlags VkSwapchainCreateFlagsKHR |
| 1506 | //@extension("VK_KHR_swapchain") |
| 1507 | //bitfield VkSwapchainCreateFlagBitsKHR { |
| 1508 | //} |
| 1509 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1510 | @extension("VK_KHR_display") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1511 | type VkFlags VkDisplayPlaneAlphaFlagsKHR |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1512 | @extension("VK_KHR_display") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1513 | bitfield VkDisplayPlaneAlphaFlagBitsKHR { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1514 | VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, |
| 1515 | VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002, |
| 1516 | VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004, |
| 1517 | VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 1518 | } |
| 1519 | |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1520 | @extension("VK_KHR_display") |
| 1521 | type VkFlags VkDisplaySurfaceCreateFlagsKHR |
| 1522 | //@extension("VK_KHR_display") |
| 1523 | //bitfield VkDisplaySurfaceCreateFlagBitsKHR { |
| 1524 | //} |
| 1525 | |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 1526 | @extension("VK_KHR_display") |
| 1527 | type VkFlags VkDisplayModeCreateFlagsKHR |
| 1528 | //@extension("VK_KHR_display") |
| 1529 | //bitfield VkDisplayModeCreateFlagBitsKHR { |
| 1530 | //} |
| 1531 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1532 | @extension("VK_KHR_xlib_surface") |
| 1533 | type VkFlags VkXlibSurfaceCreateFlagsKHR |
| 1534 | //@extension("VK_KHR_xlib_surface") |
| 1535 | //bitfield VkXlibSurfaceCreateFlagBitsKHR { |
| 1536 | //} |
| 1537 | |
| 1538 | @extension("VK_KHR_xcb_surface") |
| 1539 | type VkFlags VkXcbSurfaceCreateFlagsKHR |
| 1540 | //@extension("VK_KHR_xcb_surface") |
| 1541 | //bitfield VkXcbSurfaceCreateFlagBitsKHR { |
| 1542 | //} |
| 1543 | |
| 1544 | @extension("VK_KHR_wayland_surface") |
| 1545 | type VkFlags VkWaylandSurfaceCreateFlagsKHR |
| 1546 | //@extension("VK_KHR_wayland_surface") |
| 1547 | //bitfield VkWaylandSurfaceCreateFlagBitsKHR { |
| 1548 | //} |
| 1549 | |
| 1550 | @extension("VK_KHR_mir_surface") |
| 1551 | type VkFlags VkMirSurfaceCreateFlagsKHR |
| 1552 | //@extension("VK_KHR_mir_surface") |
| 1553 | //bitfield VkMirSurfaceCreateFlagBitsKHR { |
| 1554 | //} |
| 1555 | |
| 1556 | @extension("VK_KHR_android_surface") |
| 1557 | type VkFlags VkAndroidSurfaceCreateFlagsKHR |
| 1558 | //@extension("VK_KHR_android_surface") |
| 1559 | //bitfield VkAndroidSurfaceCreateFlagBitsKHR { |
| 1560 | //} |
| 1561 | |
| 1562 | @extension("VK_KHR_win32_surface") |
| 1563 | type VkFlags VkWin32SurfaceCreateFlagsKHR |
| 1564 | //@extension("VK_KHR_win32_surface") |
| 1565 | //bitfield VkWin32SurfaceCreateFlagBitsKHR { |
| 1566 | //} |
| 1567 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 1568 | @extension("VK_EXT_debug_report") |
| 1569 | type VkFlags VkDebugReportFlagsEXT |
| 1570 | @extension("VK_EXT_debug_report") |
| 1571 | bitfield VkDebugReportFlagBitsEXT { |
Jesse Hall | e2948d8 | 2016-02-25 04:19:32 -0800 | [diff] [blame] | 1572 | VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001, |
| 1573 | VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002, |
| 1574 | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004, |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 1575 | VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008, |
| 1576 | VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010, |
| 1577 | } |
| 1578 | |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 1579 | @extension("VK_ANDROID_native_buffer") |
| 1580 | type VkFlags VkSwapchainImageUsageFlagsANDROID |
| 1581 | @extension("VK_ANDROID_native_buffer") |
| 1582 | bitfield VkSwapchainImageUsageFlagBitsANDROID { |
Chris Forbes | 4da65b9 | 2017-01-31 11:48:50 +1300 | [diff] [blame] | 1583 | VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_SHARED_BIT_ANDROID = 0x00000001, |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 1584 | } |
| 1585 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 1586 | @extension("VK_NV_external_memory_capabilities") |
| 1587 | type VkFlags VkExternalMemoryHandleTypeFlagsNV |
| 1588 | @extension("VK_NV_external_memory_capabilities") |
| 1589 | bitfield VkExternalMemoryHandleTypeFlagBitsNV { |
| 1590 | VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001, |
| 1591 | VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002, |
| 1592 | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004, |
| 1593 | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008, |
| 1594 | } |
| 1595 | |
| 1596 | @extension("VK_NV_external_memory_capabilities") |
| 1597 | type VkFlags VkExternalMemoryFeatureFlagsNV |
| 1598 | @extension("VK_NV_external_memory_capabilities") |
| 1599 | bitfield VkExternalMemoryFeatureFlagBitsNV { |
| 1600 | VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001, |
| 1601 | VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002, |
| 1602 | VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004, |
| 1603 | } |
| 1604 | |
| 1605 | @extension("VK_NVX_device_generated_commands") |
| 1606 | type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX |
| 1607 | @extension("VK_NVX_device_generated_commands") |
| 1608 | bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX { |
| 1609 | VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001, |
| 1610 | VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002, |
| 1611 | VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004, |
| 1612 | VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008, |
| 1613 | } |
| 1614 | |
| 1615 | @extension("VK_NVX_device_generated_commands") |
| 1616 | type VkFlags VkObjectEntryUsageFlagsNVX |
| 1617 | @extension("VK_NVX_device_generated_commands") |
| 1618 | bitfield VkObjectEntryUsageFlagBitsNVX { |
| 1619 | VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001, |
| 1620 | VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002, |
| 1621 | } |
| 1622 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 1623 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1624 | ////////////////// |
| 1625 | // Structures // |
| 1626 | ////////////////// |
| 1627 | |
| 1628 | class VkOffset2D { |
| 1629 | s32 x |
| 1630 | s32 y |
| 1631 | } |
| 1632 | |
| 1633 | class VkOffset3D { |
| 1634 | s32 x |
| 1635 | s32 y |
| 1636 | s32 z |
| 1637 | } |
| 1638 | |
| 1639 | class VkExtent2D { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1640 | u32 width |
| 1641 | u32 height |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1642 | } |
| 1643 | |
| 1644 | class VkExtent3D { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1645 | u32 width |
| 1646 | u32 height |
| 1647 | u32 depth |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1648 | } |
| 1649 | |
| 1650 | class VkViewport { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1651 | f32 x |
| 1652 | f32 y |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1653 | f32 width |
| 1654 | f32 height |
| 1655 | f32 minDepth |
| 1656 | f32 maxDepth |
| 1657 | } |
| 1658 | |
| 1659 | class VkRect2D { |
| 1660 | VkOffset2D offset |
| 1661 | VkExtent2D extent |
| 1662 | } |
| 1663 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1664 | class VkClearRect { |
| 1665 | VkRect2D rect |
| 1666 | u32 baseArrayLayer |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1667 | u32 layerCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1668 | } |
| 1669 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1670 | class VkComponentMapping { |
| 1671 | VkComponentSwizzle r |
| 1672 | VkComponentSwizzle g |
| 1673 | VkComponentSwizzle b |
| 1674 | VkComponentSwizzle a |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1675 | } |
| 1676 | |
| 1677 | class VkPhysicalDeviceProperties { |
| 1678 | u32 apiVersion |
| 1679 | u32 driverVersion |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1680 | u32 vendorID |
| 1681 | u32 deviceID |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1682 | VkPhysicalDeviceType deviceType |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1683 | char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName |
| 1684 | u8[VK_UUID_SIZE] pipelineCacheUUID |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1685 | VkPhysicalDeviceLimits limits |
| 1686 | VkPhysicalDeviceSparseProperties sparseProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1687 | } |
| 1688 | |
| 1689 | class VkExtensionProperties { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1690 | char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1691 | u32 specVersion /// version of the extension specification implemented |
| 1692 | } |
| 1693 | |
| 1694 | class VkLayerProperties { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1695 | char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1696 | u32 specVersion /// version of the layer specification implemented |
| 1697 | u32 implementationVersion /// build or release version of the layer's library |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1698 | char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1699 | } |
| 1700 | |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1701 | class VkSubmitInfo { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1702 | VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO |
| 1703 | const void* pNext /// Next structure in chain |
| 1704 | u32 waitSemaphoreCount |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1705 | const VkSemaphore* pWaitSemaphores |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 1706 | const VkPipelineStageFlags* pWaitDstStageMask |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1707 | u32 commandBufferCount |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1708 | const VkCommandBuffer* pCommandBuffers |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1709 | u32 signalSemaphoreCount |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1710 | const VkSemaphore* pSignalSemaphores |
| 1711 | } |
| 1712 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1713 | class VkApplicationInfo { |
| 1714 | VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO |
| 1715 | const void* pNext /// Next structure in chain |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1716 | const char* pApplicationName |
| 1717 | u32 applicationVersion |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1718 | const char* pEngineName |
| 1719 | u32 engineVersion |
| 1720 | u32 apiVersion |
| 1721 | } |
| 1722 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1723 | class VkAllocationCallbacks { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1724 | void* pUserData |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1725 | PFN_vkAllocationFunction pfnAllocation |
| 1726 | PFN_vkReallocationFunction pfnReallocation |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1727 | PFN_vkFreeFunction pfnFree |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1728 | PFN_vkInternalAllocationNotification pfnInternalAllocation |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1729 | PFN_vkInternalFreeNotification pfnInternalFree |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1730 | } |
| 1731 | |
| 1732 | class VkDeviceQueueCreateInfo { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1733 | VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO |
| 1734 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1735 | VkDeviceQueueCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1736 | u32 queueFamilyIndex |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 1737 | u32 queueCount |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1738 | const f32* pQueuePriorities |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1739 | } |
| 1740 | |
| 1741 | class VkDeviceCreateInfo { |
| 1742 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO |
| 1743 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1744 | VkDeviceCreateFlags flags |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 1745 | u32 queueCreateInfoCount |
| 1746 | const VkDeviceQueueCreateInfo* pQueueCreateInfos |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1747 | u32 enabledLayerCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1748 | const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1749 | u32 enabledExtensionCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1750 | const char* const* ppEnabledExtensionNames |
| 1751 | const VkPhysicalDeviceFeatures* pEnabledFeatures |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1752 | } |
| 1753 | |
| 1754 | class VkInstanceCreateInfo { |
| 1755 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO |
| 1756 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1757 | VkInstanceCreateFlags flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1758 | const VkApplicationInfo* pApplicationInfo |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1759 | u32 enabledLayerCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1760 | const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1761 | u32 enabledExtensionCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1762 | const char* const* ppEnabledExtensionNames /// Extension names to be enabled |
| 1763 | } |
| 1764 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1765 | class VkQueueFamilyProperties { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1766 | VkQueueFlags queueFlags /// Queue flags |
| 1767 | u32 queueCount |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 1768 | u32 timestampValidBits |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1769 | VkExtent3D minImageTransferGranularity |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1770 | } |
| 1771 | |
| 1772 | class VkPhysicalDeviceMemoryProperties { |
| 1773 | u32 memoryTypeCount |
| 1774 | VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes |
| 1775 | u32 memoryHeapCount |
| 1776 | VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps |
| 1777 | } |
| 1778 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1779 | class VkMemoryAllocateInfo { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1780 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1781 | const void* pNext /// Pointer to next structure |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1782 | VkDeviceSize allocationSize /// Size of memory allocation |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1783 | u32 memoryTypeIndex /// Index of the of the memory type to allocate from |
| 1784 | } |
| 1785 | |
| 1786 | class VkMemoryRequirements { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1787 | VkDeviceSize size /// Specified in bytes |
| 1788 | VkDeviceSize alignment /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1789 | u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object |
| 1790 | } |
| 1791 | |
| 1792 | class VkSparseImageFormatProperties { |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1793 | VkImageAspectFlagBits aspectMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1794 | VkExtent3D imageGranularity |
| 1795 | VkSparseImageFormatFlags flags |
| 1796 | } |
| 1797 | |
| 1798 | class VkSparseImageMemoryRequirements { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1799 | VkSparseImageFormatProperties formatProperties |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1800 | u32 imageMipTailFirstLod |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1801 | VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment |
| 1802 | VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment |
| 1803 | VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1804 | } |
| 1805 | |
| 1806 | class VkMemoryType { |
| 1807 | VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type |
| 1808 | u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from |
| 1809 | } |
| 1810 | |
| 1811 | class VkMemoryHeap { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1812 | VkDeviceSize size /// Available memory in the heap |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1813 | VkMemoryHeapFlags flags /// Flags for the heap |
| 1814 | } |
| 1815 | |
| 1816 | class VkMappedMemoryRange { |
| 1817 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE |
| 1818 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1819 | VkDeviceMemory memory /// Mapped memory object |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1820 | VkDeviceSize offset /// Offset within the mapped memory the range starts from |
| 1821 | VkDeviceSize size /// Size of the range within the mapped memory |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1822 | } |
| 1823 | |
| 1824 | class VkFormatProperties { |
| 1825 | VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling |
| 1826 | VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1827 | VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1828 | } |
| 1829 | |
| 1830 | class VkImageFormatProperties { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1831 | VkExtent3D maxExtent /// max image dimensions for this resource type |
| 1832 | u32 maxMipLevels /// max number of mipmap levels for this resource type |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1833 | u32 maxArrayLayers /// max array layers for this resource type |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1834 | VkSampleCountFlags sampleCounts /// supported sample counts for this resource type |
| 1835 | VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type |
| 1836 | } |
| 1837 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1838 | class VkDescriptorImageInfo { |
| 1839 | VkSampler sampler |
| 1840 | VkImageView imageView |
| 1841 | VkImageLayout imageLayout |
| 1842 | } |
| 1843 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1844 | class VkDescriptorBufferInfo { |
| 1845 | VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC] |
| 1846 | VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set. |
| 1847 | VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update. |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1848 | } |
| 1849 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1850 | class VkWriteDescriptorSet { |
| 1851 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET |
| 1852 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1853 | VkDescriptorSet dstSet /// Destination descriptor set |
| 1854 | u32 dstBinding /// Binding within the destination descriptor set to write |
| 1855 | u32 dstArrayElement /// Array element within the destination binding to write |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1856 | u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1857 | VkDescriptorType descriptorType /// Descriptor type to write (determines which fields of the array pointed by <pDescriptors> are going to be used) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1858 | const VkDescriptorImageInfo* pImageInfo |
| 1859 | const VkDescriptorBufferInfo* pBufferInfo |
| 1860 | const VkBufferView* pTexelBufferView |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1861 | } |
| 1862 | |
| 1863 | class VkCopyDescriptorSet { |
| 1864 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET |
| 1865 | const void* pNext /// Pointer to next structure |
| 1866 | VkDescriptorSet srcSet /// Source descriptor set |
| 1867 | u32 srcBinding /// Binding within the source descriptor set to copy from |
| 1868 | u32 srcArrayElement /// Array element within the source binding to copy from |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1869 | VkDescriptorSet dstSet /// Destination descriptor set |
| 1870 | u32 dstBinding /// Binding within the destination descriptor set to copy to |
| 1871 | u32 dstArrayElement /// Array element within the destination binding to copy to |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1872 | u32 descriptorCount /// Number of descriptors to copy |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1873 | } |
| 1874 | |
| 1875 | class VkBufferCreateInfo { |
| 1876 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO |
| 1877 | const void* pNext /// Pointer to next structure. |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1878 | VkBufferCreateFlags flags /// Buffer creation flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1879 | VkDeviceSize size /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1880 | VkBufferUsageFlags usage /// Buffer usage flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1881 | VkSharingMode sharingMode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1882 | u32 queueFamilyIndexCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1883 | const u32* pQueueFamilyIndices |
| 1884 | } |
| 1885 | |
| 1886 | class VkBufferViewCreateInfo { |
| 1887 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO |
| 1888 | const void* pNext /// Pointer to next structure. |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1889 | VkBufferViewCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1890 | VkBuffer buffer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1891 | VkFormat format /// Optionally specifies format of elements |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1892 | VkDeviceSize offset /// Specified in bytes |
| 1893 | VkDeviceSize range /// View size specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1894 | } |
| 1895 | |
| 1896 | class VkImageSubresource { |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1897 | VkImageAspectFlagBits aspectMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1898 | u32 mipLevel |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1899 | u32 arrayLayer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1900 | } |
| 1901 | |
| 1902 | class VkImageSubresourceRange { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1903 | VkImageAspectFlags aspectMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1904 | u32 baseMipLevel |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1905 | u32 levelCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1906 | u32 baseArrayLayer |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1907 | u32 layerCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1908 | } |
| 1909 | |
| 1910 | class VkMemoryBarrier { |
| 1911 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER |
| 1912 | const void* pNext /// Pointer to next structure. |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1913 | VkAccessFlags srcAccessMask |
| 1914 | VkAccessFlags dstAccessMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1915 | } |
| 1916 | |
| 1917 | class VkBufferMemoryBarrier { |
| 1918 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER |
| 1919 | const void* pNext /// Pointer to next structure. |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1920 | VkAccessFlags srcAccessMask |
| 1921 | VkAccessFlags dstAccessMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1922 | u32 srcQueueFamilyIndex /// Queue family to transition ownership from |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1923 | u32 dstQueueFamilyIndex /// Queue family to transition ownership to |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1924 | VkBuffer buffer /// Buffer to sync |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1925 | VkDeviceSize offset /// Offset within the buffer to sync |
| 1926 | VkDeviceSize size /// Amount of bytes to sync |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1927 | } |
| 1928 | |
| 1929 | class VkImageMemoryBarrier { |
| 1930 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER |
| 1931 | const void* pNext /// Pointer to next structure. |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1932 | VkAccessFlags srcAccessMask |
| 1933 | VkAccessFlags dstAccessMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1934 | VkImageLayout oldLayout /// Current layout of the image |
| 1935 | VkImageLayout newLayout /// New layout to transition the image to |
| 1936 | u32 srcQueueFamilyIndex /// Queue family to transition ownership from |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1937 | u32 dstQueueFamilyIndex /// Queue family to transition ownership to |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1938 | VkImage image /// Image to sync |
| 1939 | VkImageSubresourceRange subresourceRange /// Subresource range to sync |
| 1940 | } |
| 1941 | |
| 1942 | class VkImageCreateInfo { |
| 1943 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO |
| 1944 | const void* pNext /// Pointer to next structure. |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1945 | VkImageCreateFlags flags /// Image creation flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1946 | VkImageType imageType |
| 1947 | VkFormat format |
| 1948 | VkExtent3D extent |
| 1949 | u32 mipLevels |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1950 | u32 arrayLayers |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 1951 | VkSampleCountFlagBits samples |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1952 | VkImageTiling tiling |
| 1953 | VkImageUsageFlags usage /// Image usage flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1954 | VkSharingMode sharingMode /// Cross-queue-family sharing mode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1955 | u32 queueFamilyIndexCount /// Number of queue families to share across |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1956 | const u32* pQueueFamilyIndices /// Array of queue family indices to share across |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1957 | VkImageLayout initialLayout /// Initial image layout for all subresources |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1958 | } |
| 1959 | |
| 1960 | class VkSubresourceLayout { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1961 | VkDeviceSize offset /// Specified in bytes |
| 1962 | VkDeviceSize size /// Specified in bytes |
| 1963 | VkDeviceSize rowPitch /// Specified in bytes |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 1964 | VkDeviceSize arrayPitch /// Specified in bytes |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1965 | VkDeviceSize depthPitch /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1966 | } |
| 1967 | |
| 1968 | class VkImageViewCreateInfo { |
| 1969 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO |
| 1970 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1971 | VkImageViewCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1972 | VkImage image |
| 1973 | VkImageViewType viewType |
| 1974 | VkFormat format |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1975 | VkComponentMapping components |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1976 | VkImageSubresourceRange subresourceRange |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1977 | } |
| 1978 | |
| 1979 | class VkBufferCopy { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1980 | VkDeviceSize srcOffset /// Specified in bytes |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1981 | VkDeviceSize dstOffset /// Specified in bytes |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1982 | VkDeviceSize size /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1983 | } |
| 1984 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1985 | class VkSparseMemoryBind { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1986 | VkDeviceSize resourceOffset /// Specified in bytes |
| 1987 | VkDeviceSize size /// Specified in bytes |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1988 | VkDeviceMemory memory |
| 1989 | VkDeviceSize memoryOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1990 | VkSparseMemoryBindFlags flags |
| 1991 | } |
| 1992 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1993 | class VkSparseImageMemoryBind { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1994 | VkImageSubresource subresource |
| 1995 | VkOffset3D offset |
| 1996 | VkExtent3D extent |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1997 | VkDeviceMemory memory |
| 1998 | VkDeviceSize memoryOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1999 | VkSparseMemoryBindFlags flags |
| 2000 | } |
| 2001 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2002 | class VkSparseBufferMemoryBindInfo { |
| 2003 | VkBuffer buffer |
| 2004 | u32 bindCount |
| 2005 | const VkSparseMemoryBind* pBinds |
| 2006 | } |
| 2007 | |
| 2008 | class VkSparseImageOpaqueMemoryBindInfo { |
| 2009 | VkImage image |
| 2010 | u32 bindCount |
| 2011 | const VkSparseMemoryBind* pBinds |
| 2012 | } |
| 2013 | |
| 2014 | class VkSparseImageMemoryBindInfo { |
| 2015 | VkImage image |
| 2016 | u32 bindCount |
| 2017 | const VkSparseMemoryBind* pBinds |
| 2018 | } |
| 2019 | |
| 2020 | class VkBindSparseInfo { |
| 2021 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO |
| 2022 | const void* pNext |
| 2023 | u32 waitSemaphoreCount |
| 2024 | const VkSemaphore* pWaitSemaphores |
| 2025 | u32 numBufferBinds |
| 2026 | const VkSparseBufferMemoryBindInfo* pBufferBinds |
| 2027 | u32 numImageOpaqueBinds |
| 2028 | const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds |
| 2029 | u32 numImageBinds |
| 2030 | const VkSparseImageMemoryBindInfo* pImageBinds |
| 2031 | u32 signalSemaphoreCount |
| 2032 | const VkSemaphore* pSignalSemaphores |
| 2033 | } |
| 2034 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2035 | class VkImageSubresourceLayers { |
| 2036 | VkImageAspectFlags aspectMask |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2037 | u32 mipLevel |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 2038 | u32 baseArrayLayer |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2039 | u32 layerCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2040 | } |
| 2041 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2042 | class VkImageCopy { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2043 | VkImageSubresourceLayers srcSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2044 | VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2045 | VkImageSubresourceLayers dstSubresource |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2046 | VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2047 | VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images |
| 2048 | } |
| 2049 | |
| 2050 | class VkImageBlit { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2051 | VkImageSubresourceLayers srcSubresource |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2052 | VkOffset3D[2] srcOffsets |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2053 | VkImageSubresourceLayers dstSubresource |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2054 | VkOffset3D[2] dstOffsets |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2055 | } |
| 2056 | |
| 2057 | class VkBufferImageCopy { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2058 | VkDeviceSize bufferOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2059 | u32 bufferRowLength /// Specified in texels |
| 2060 | u32 bufferImageHeight |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2061 | VkImageSubresourceLayers imageSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2062 | VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images |
| 2063 | VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images |
| 2064 | } |
| 2065 | |
| 2066 | class VkImageResolve { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2067 | VkImageSubresourceLayers srcSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2068 | VkOffset3D srcOffset |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2069 | VkImageSubresourceLayers dstSubresource |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2070 | VkOffset3D dstOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2071 | VkExtent3D extent |
| 2072 | } |
| 2073 | |
| 2074 | class VkShaderModuleCreateInfo { |
| 2075 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO |
| 2076 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2077 | VkShaderModuleCreateFlags flags /// Reserved |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2078 | platform.size_t codeSize /// Specified in bytes |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2079 | const u32* pCode /// Binary code of size codeSize |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2080 | } |
| 2081 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2082 | class VkDescriptorSetLayoutBinding { |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2083 | u32 binding |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2084 | VkDescriptorType descriptorType /// Type of the descriptors in this binding |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 2085 | u32 descriptorCount /// Number of descriptors in this binding |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2086 | VkShaderStageFlags stageFlags /// Shader stages this binding is visible to |
| 2087 | const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements) |
| 2088 | } |
| 2089 | |
| 2090 | class VkDescriptorSetLayoutCreateInfo { |
| 2091 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO |
| 2092 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2093 | VkDescriptorSetLayoutCreateFlags flags |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2094 | u32 bindingCount /// Number of bindings in the descriptor set layout |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 2095 | const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2096 | } |
| 2097 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2098 | class VkDescriptorPoolSize { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2099 | VkDescriptorType type |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2100 | u32 descriptorCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2101 | } |
| 2102 | |
| 2103 | class VkDescriptorPoolCreateInfo { |
| 2104 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO |
| 2105 | const void* pNext /// Pointer to next structure |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2106 | VkDescriptorPoolCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2107 | u32 maxSets |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2108 | u32 poolSizeCount |
| 2109 | const VkDescriptorPoolSize* pPoolSizes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2110 | } |
| 2111 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2112 | class VkDescriptorSetAllocateInfo { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2113 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2114 | const void* pNext /// Pointer to next structure |
| 2115 | VkDescriptorPool descriptorPool |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2116 | u32 setCount |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2117 | const VkDescriptorSetLayout* pSetLayouts |
| 2118 | } |
| 2119 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2120 | class VkSpecializationMapEntry { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2121 | u32 constantID /// The SpecConstant ID specified in the BIL |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2122 | u32 offset /// Offset of the value in the data block |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2123 | platform.size_t size /// Size in bytes of the SpecConstant |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2124 | } |
| 2125 | |
| 2126 | class VkSpecializationInfo { |
| 2127 | u32 mapEntryCount /// Number of entries in the map |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2128 | const VkSpecializationMapEntry* pMapEntries /// Array of map entries |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2129 | platform.size_t dataSize /// Size in bytes of pData |
| 2130 | const void* pData /// Pointer to SpecConstant data |
| 2131 | } |
| 2132 | |
| 2133 | class VkPipelineShaderStageCreateInfo { |
| 2134 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO |
| 2135 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2136 | VkPipelineShaderStageCreateFlags flags |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2137 | VkShaderStageFlagBits stage |
| 2138 | VkShaderModule module |
| 2139 | const char* pName |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2140 | const VkSpecializationInfo* pSpecializationInfo |
| 2141 | } |
| 2142 | |
| 2143 | class VkComputePipelineCreateInfo { |
| 2144 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO |
| 2145 | const void* pNext /// Pointer to next structure |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2146 | VkPipelineCreateFlags flags /// Pipeline creation flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2147 | VkPipelineShaderStageCreateInfo stage |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2148 | VkPipelineLayout layout /// Interface layout of the pipeline |
| 2149 | 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 |
| 2150 | 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 |
| 2151 | } |
| 2152 | |
| 2153 | class VkVertexInputBindingDescription { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2154 | u32 binding /// Vertex buffer binding id |
| 2155 | u32 stride /// Distance between vertices in bytes (0 = no advancement) |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2156 | VkVertexInputRate inputRate /// Rate at which binding is incremented |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2157 | } |
| 2158 | |
| 2159 | class VkVertexInputAttributeDescription { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2160 | u32 location /// location of the shader vertex attrib |
| 2161 | u32 binding /// Vertex buffer binding id |
| 2162 | VkFormat format /// format of source data |
| 2163 | u32 offset /// Offset of first element in bytes from base of vertex |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2164 | } |
| 2165 | |
| 2166 | class VkPipelineVertexInputStateCreateInfo { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2167 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO |
| 2168 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2169 | VkPipelineVertexInputStateCreateFlags flags |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2170 | u32 vertexBindingDescriptionCount /// number of bindings |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2171 | const VkVertexInputBindingDescription* pVertexBindingDescriptions |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2172 | u32 vertexAttributeDescriptionCount /// number of attributes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2173 | const VkVertexInputAttributeDescription* pVertexAttributeDescriptions |
| 2174 | } |
| 2175 | |
| 2176 | class VkPipelineInputAssemblyStateCreateInfo { |
| 2177 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO |
| 2178 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2179 | VkPipelineInputAssemblyStateCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2180 | VkPrimitiveTopology topology |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2181 | VkBool32 primitiveRestartEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2182 | } |
| 2183 | |
| 2184 | class VkPipelineTessellationStateCreateInfo { |
| 2185 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO |
| 2186 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2187 | VkPipelineTessellationStateCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2188 | u32 patchControlPoints |
| 2189 | } |
| 2190 | |
| 2191 | class VkPipelineViewportStateCreateInfo { |
| 2192 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO |
| 2193 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2194 | VkPipelineViewportStateCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2195 | u32 viewportCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2196 | const VkViewport* pViewports |
| 2197 | u32 scissorCount |
| 2198 | const VkRect2D* pScissors |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2199 | } |
| 2200 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2201 | class VkPipelineRasterizationStateCreateInfo { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2202 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2203 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2204 | VkPipelineRasterizationStateCreateFlags flags |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2205 | VkBool32 depthClampEnable |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2206 | VkBool32 rasterizerDiscardEnable |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2207 | VkPolygonMode polygonMode /// optional (GL45) |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 2208 | VkCullModeFlags cullMode |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2209 | VkFrontFace frontFace |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2210 | VkBool32 depthBiasEnable |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2211 | f32 depthBiasConstantFactor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2212 | f32 depthBiasClamp |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2213 | f32 depthBiasSlopeFactor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2214 | f32 lineWidth |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2215 | } |
| 2216 | |
| 2217 | class VkPipelineMultisampleStateCreateInfo { |
| 2218 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO |
| 2219 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2220 | VkPipelineMultisampleStateCreateFlags flags |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2221 | VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2222 | VkBool32 sampleShadingEnable /// optional (GL45) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2223 | f32 minSampleShading /// optional (GL45) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2224 | const VkSampleMask* pSampleMask |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 2225 | VkBool32 alphaToCoverageEnable |
| 2226 | VkBool32 alphaToOneEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2227 | } |
| 2228 | |
| 2229 | class VkPipelineColorBlendAttachmentState { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2230 | VkBool32 blendEnable |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2231 | VkBlendFactor srcColorBlendFactor |
| 2232 | VkBlendFactor dstColorBlendFactor |
| 2233 | VkBlendOp colorBlendOp |
| 2234 | VkBlendFactor srcAlphaBlendFactor |
| 2235 | VkBlendFactor dstAlphaBlendFactor |
| 2236 | VkBlendOp alphaBlendOp |
| 2237 | VkColorComponentFlags colorWriteMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2238 | } |
| 2239 | |
| 2240 | class VkPipelineColorBlendStateCreateInfo { |
| 2241 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO |
| 2242 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2243 | VkPipelineColorBlendStateCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2244 | VkBool32 logicOpEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2245 | VkLogicOp logicOp |
| 2246 | u32 attachmentCount /// # of pAttachments |
| 2247 | const VkPipelineColorBlendAttachmentState* pAttachments |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2248 | f32[4] blendConstants |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2249 | } |
| 2250 | |
| 2251 | class VkStencilOpState { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2252 | VkStencilOp failOp |
| 2253 | VkStencilOp passOp |
| 2254 | VkStencilOp depthFailOp |
| 2255 | VkCompareOp compareOp |
| 2256 | u32 compareMask |
| 2257 | u32 writeMask |
| 2258 | u32 reference |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2259 | } |
| 2260 | |
| 2261 | class VkPipelineDepthStencilStateCreateInfo { |
| 2262 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO |
| 2263 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2264 | VkPipelineDepthStencilStateCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2265 | VkBool32 depthTestEnable |
| 2266 | VkBool32 depthWriteEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2267 | VkCompareOp depthCompareOp |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2268 | VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test) |
| 2269 | VkBool32 stencilTestEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2270 | VkStencilOpState front |
| 2271 | VkStencilOpState back |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2272 | f32 minDepthBounds |
| 2273 | f32 maxDepthBounds |
| 2274 | } |
| 2275 | |
| 2276 | class VkPipelineDynamicStateCreateInfo { |
| 2277 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO |
| 2278 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2279 | VkPipelineDynamicStateCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2280 | u32 dynamicStateCount |
| 2281 | const VkDynamicState* pDynamicStates |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2282 | } |
| 2283 | |
| 2284 | class VkGraphicsPipelineCreateInfo { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2285 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO |
| 2286 | const void* pNext /// Pointer to next structure |
| 2287 | VkPipelineCreateFlags flags /// Pipeline creation flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2288 | u32 stageCount |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2289 | const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2290 | const VkPipelineVertexInputStateCreateInfo* pVertexInputState |
| 2291 | const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState |
| 2292 | const VkPipelineTessellationStateCreateInfo* pTessellationState |
| 2293 | const VkPipelineViewportStateCreateInfo* pViewportState |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2294 | const VkPipelineRasterizationStateCreateInfo* pRasterizationState |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2295 | const VkPipelineMultisampleStateCreateInfo* pMultisampleState |
| 2296 | const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState |
| 2297 | const VkPipelineColorBlendStateCreateInfo* pColorBlendState |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2298 | const VkPipelineDynamicStateCreateInfo* pDynamicState |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2299 | VkPipelineLayout layout /// Interface layout of the pipeline |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2300 | VkRenderPass renderPass |
| 2301 | u32 subpass |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2302 | 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 |
| 2303 | 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 Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2304 | } |
| 2305 | |
| 2306 | class VkPipelineCacheCreateInfo { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2307 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO |
| 2308 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2309 | VkPipelineCacheCreateFlags flags |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2310 | platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes |
| 2311 | const void* pInitialData /// Initial data to populate cache |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2312 | } |
| 2313 | |
| 2314 | class VkPushConstantRange { |
| 2315 | VkShaderStageFlags stageFlags /// Which stages use the range |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2316 | u32 offset /// Start of the range, in bytes |
| 2317 | u32 size /// Length of the range, in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2318 | } |
| 2319 | |
| 2320 | class VkPipelineLayoutCreateInfo { |
| 2321 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO |
| 2322 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2323 | VkPipelineLayoutCreateFlags flags |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2324 | u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2325 | const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the |
| 2326 | u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline |
| 2327 | const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages |
| 2328 | } |
| 2329 | |
| 2330 | class VkSamplerCreateInfo { |
| 2331 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO |
| 2332 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2333 | VkSamplerCreateFlags flags |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 2334 | VkFilter magFilter /// Filter mode for magnification |
| 2335 | VkFilter minFilter /// Filter mode for minifiation |
| 2336 | VkSamplerMipmapMode mipmapMode /// Mipmap selection mode |
| 2337 | VkSamplerAddressMode addressModeU |
| 2338 | VkSamplerAddressMode addressModeV |
| 2339 | VkSamplerAddressMode addressModeW |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2340 | f32 mipLodBias |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2341 | VkBool32 anisotropyEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2342 | f32 maxAnisotropy |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2343 | VkBool32 compareEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2344 | VkCompareOp compareOp |
| 2345 | f32 minLod |
| 2346 | f32 maxLod |
| 2347 | VkBorderColor borderColor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2348 | VkBool32 unnormalizedCoordinates |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2349 | } |
| 2350 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2351 | class VkCommandPoolCreateInfo { |
| 2352 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2353 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2354 | VkCommandPoolCreateFlags flags /// Command pool creation flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2355 | u32 queueFamilyIndex |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2356 | } |
| 2357 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2358 | class VkCommandBufferAllocateInfo { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2359 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2360 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2361 | VkCommandPool commandPool |
| 2362 | VkCommandBufferLevel level |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2363 | u32 commandBufferCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2364 | } |
| 2365 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2366 | class VkCommandBufferInheritanceInfo { |
| 2367 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2368 | const void* pNext /// Pointer to next structure |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2369 | VkRenderPass renderPass /// Render pass for secondary command buffers |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2370 | u32 subpass |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2371 | VkFramebuffer framebuffer /// Framebuffer for secondary command buffers |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2372 | VkBool32 occlusionQueryEnable |
| 2373 | VkQueryControlFlags queryFlags |
| 2374 | VkQueryPipelineStatisticFlags pipelineStatistics |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2375 | } |
| 2376 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2377 | class VkCommandBufferBeginInfo { |
| 2378 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO |
| 2379 | const void* pNext /// Pointer to next structure |
| 2380 | VkCommandBufferUsageFlags flags /// Command buffer usage flags |
| 2381 | const VkCommandBufferInheritanceInfo* pInheritanceInfo |
| 2382 | } |
| 2383 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2384 | class VkRenderPassBeginInfo { |
| 2385 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO |
| 2386 | const void* pNext /// Pointer to next structure |
| 2387 | VkRenderPass renderPass |
| 2388 | VkFramebuffer framebuffer |
| 2389 | VkRect2D renderArea |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2390 | u32 clearValueCount |
| 2391 | const VkClearValue* pClearValues |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2392 | } |
| 2393 | |
| 2394 | @union |
| 2395 | /// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared. |
| 2396 | class VkClearColorValue { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2397 | f32[4] float32 |
| 2398 | s32[4] int32 |
| 2399 | u32[4] uint32 |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2400 | } |
| 2401 | |
| 2402 | class VkClearDepthStencilValue { |
| 2403 | f32 depth |
| 2404 | u32 stencil |
| 2405 | } |
| 2406 | |
| 2407 | @union |
| 2408 | /// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared. |
| 2409 | class VkClearValue { |
| 2410 | VkClearColorValue color |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2411 | VkClearDepthStencilValue depthStencil |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2412 | } |
| 2413 | |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2414 | class VkClearAttachment { |
| 2415 | VkImageAspectFlags aspectMask |
| 2416 | u32 colorAttachment |
| 2417 | VkClearValue clearValue |
| 2418 | } |
| 2419 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2420 | class VkAttachmentDescription { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2421 | VkAttachmentDescriptionFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2422 | VkFormat format |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2423 | VkSampleCountFlagBits samples |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2424 | VkAttachmentLoadOp loadOp /// Load op for color or depth data |
| 2425 | VkAttachmentStoreOp storeOp /// Store op for color or depth data |
| 2426 | VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data |
| 2427 | VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data |
| 2428 | VkImageLayout initialLayout |
| 2429 | VkImageLayout finalLayout |
| 2430 | } |
| 2431 | |
| 2432 | class VkAttachmentReference { |
| 2433 | u32 attachment |
| 2434 | VkImageLayout layout |
| 2435 | } |
| 2436 | |
| 2437 | class VkSubpassDescription { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2438 | VkSubpassDescriptionFlags flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2439 | VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2440 | u32 inputAttachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2441 | const VkAttachmentReference* pInputAttachments |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2442 | u32 colorAttachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2443 | const VkAttachmentReference* pColorAttachments |
| 2444 | const VkAttachmentReference* pResolveAttachments |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 2445 | const VkAttachmentReference* pDepthStencilAttachment |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2446 | u32 preserveAttachmentCount |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2447 | const u32* pPreserveAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2448 | } |
| 2449 | |
| 2450 | class VkSubpassDependency { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2451 | u32 srcSubpass |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2452 | u32 dstSubpass |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2453 | VkPipelineStageFlags srcStageMask |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2454 | VkPipelineStageFlags dstStageMask |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2455 | VkAccessFlags srcAccessMask |
| 2456 | VkAccessFlags dstAccessMask |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 2457 | VkDependencyFlags dependencyFlags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2458 | } |
| 2459 | |
| 2460 | class VkRenderPassCreateInfo { |
| 2461 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO |
| 2462 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2463 | VkRenderPassCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2464 | u32 attachmentCount |
| 2465 | const VkAttachmentDescription* pAttachments |
| 2466 | u32 subpassCount |
| 2467 | const VkSubpassDescription* pSubpasses |
| 2468 | u32 dependencyCount |
| 2469 | const VkSubpassDependency* pDependencies |
| 2470 | } |
| 2471 | |
| 2472 | class VkEventCreateInfo { |
| 2473 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO |
| 2474 | const void* pNext /// Pointer to next structure |
| 2475 | VkEventCreateFlags flags /// Event creation flags |
| 2476 | } |
| 2477 | |
| 2478 | class VkFenceCreateInfo { |
| 2479 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO |
| 2480 | const void* pNext /// Pointer to next structure |
| 2481 | VkFenceCreateFlags flags /// Fence creation flags |
| 2482 | } |
| 2483 | |
| 2484 | class VkPhysicalDeviceFeatures { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2485 | VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined |
| 2486 | VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls |
| 2487 | VkBool32 imageCubeArray /// image views which are arrays of cube maps |
| 2488 | VkBool32 independentBlend /// blending operations are controlled per-attachment |
| 2489 | VkBool32 geometryShader /// geometry stage |
| 2490 | VkBool32 tessellationShader /// tessellation control and evaluation stage |
| 2491 | VkBool32 sampleRateShading /// per-sample shading and interpolation |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2492 | VkBool32 dualSrcBlend /// blend operations which take two sources |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2493 | VkBool32 logicOp /// logic operations |
| 2494 | VkBool32 multiDrawIndirect /// multi draw indirect |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 2495 | VkBool32 drawIndirectFirstInstance |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2496 | VkBool32 depthClamp /// depth clamping |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2497 | VkBool32 depthBiasClamp /// depth bias clamping |
| 2498 | VkBool32 fillModeNonSolid /// point and wireframe fill modes |
| 2499 | VkBool32 depthBounds /// depth bounds test |
| 2500 | VkBool32 wideLines /// lines with width greater than 1 |
| 2501 | VkBool32 largePoints /// points with size greater than 1 |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2502 | VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value |
| 2503 | VkBool32 multiViewport |
| 2504 | VkBool32 samplerAnisotropy |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2505 | VkBool32 textureCompressionETC2 /// ETC texture compression formats |
| 2506 | VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats |
| 2507 | VkBool32 textureCompressionBC /// BC1-7 texture compressed formats |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2508 | VkBool32 occlusionQueryPrecise |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2509 | VkBool32 pipelineStatisticsQuery /// pipeline statistics query |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 2510 | VkBool32 vertexPipelineStoresAndAtomics |
| 2511 | VkBool32 fragmentStoresAndAtomics |
| 2512 | VkBool32 shaderTessellationAndGeometryPointSize |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2513 | VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets |
| 2514 | VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images |
| 2515 | VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 2516 | VkBool32 shaderStorageImageReadWithoutFormat |
| 2517 | VkBool32 shaderStorageImageWriteWithoutFormat |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2518 | VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices |
| 2519 | VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices |
| 2520 | VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices |
| 2521 | VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices |
| 2522 | VkBool32 shaderClipDistance /// clip distance in shaders |
| 2523 | VkBool32 shaderCullDistance /// cull distance in shaders |
| 2524 | VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders |
| 2525 | VkBool32 shaderInt64 /// 64-bit integers in shaders |
| 2526 | VkBool32 shaderInt16 /// 16-bit integers in shaders |
| 2527 | VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support) |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2528 | VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2529 | VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level |
| 2530 | VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers |
| 2531 | VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images |
| 2532 | VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images |
| 2533 | VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples |
| 2534 | VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples |
| 2535 | VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples |
| 2536 | VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples |
| 2537 | VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in) |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 2538 | VkBool32 variableMultisampleRate |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2539 | VkBool32 inheritedQueries |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2540 | } |
| 2541 | |
| 2542 | class VkPhysicalDeviceLimits { |
| 2543 | /// resource maximum sizes |
| 2544 | u32 maxImageDimension1D /// max 1D image dimension |
| 2545 | u32 maxImageDimension2D /// max 2D image dimension |
| 2546 | u32 maxImageDimension3D /// max 3D image dimension |
| 2547 | u32 maxImageDimensionCube /// max cubemap image dimension |
| 2548 | u32 maxImageArrayLayers /// max layers for image arrays |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2549 | u32 maxTexelBufferElements |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2550 | u32 maxUniformBufferRange /// max uniform buffer size (bytes) |
| 2551 | u32 maxStorageBufferRange /// max storage buffer size (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2552 | u32 maxPushConstantsSize /// max size of the push constants pool (bytes) |
| 2553 | /// memory limits |
| 2554 | u32 maxMemoryAllocationCount /// max number of device memory allocations supported |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2555 | u32 maxSamplerAllocationCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2556 | VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage |
| 2557 | VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2558 | /// descriptor set limits |
| 2559 | u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2560 | u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set |
| 2561 | u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set |
| 2562 | u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set |
| 2563 | u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set |
| 2564 | u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 2565 | u32 maxPerStageDescriptorInputAttachments |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 2566 | u32 maxPerStageResources |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2567 | u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set |
| 2568 | u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2569 | u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2570 | u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2571 | u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2572 | u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set |
| 2573 | u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 2574 | u32 maxDescriptorSetInputAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2575 | /// vertex stage limits |
| 2576 | u32 maxVertexInputAttributes /// max num of vertex input attribute slots |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2577 | u32 maxVertexInputBindings /// max num of vertex input binding slots |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2578 | u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset |
| 2579 | u32 maxVertexInputBindingStride /// max vertex input binding stride |
| 2580 | u32 maxVertexOutputComponents /// max num of output components written by vertex shader |
| 2581 | /// tessellation control stage limits |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2582 | u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2583 | u32 maxTessellationPatchSize /// max patch size (vertices) |
| 2584 | u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS |
| 2585 | u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS |
| 2586 | u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS |
| 2587 | u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS |
| 2588 | u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES |
| 2589 | u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2590 | /// geometry stage limits |
| 2591 | u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader |
| 2592 | u32 maxGeometryInputComponents /// max num of input components read in geometry stage |
| 2593 | u32 maxGeometryOutputComponents /// max num of output components written in geometry stage |
| 2594 | u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage |
| 2595 | u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage |
| 2596 | /// fragment stage limits |
| 2597 | u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2598 | u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2599 | u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2600 | u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers |
| 2601 | /// compute stage limits |
| 2602 | u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes) |
| 2603 | u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z) |
| 2604 | u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group |
| 2605 | u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z) |
| 2606 | |
| 2607 | u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y |
| 2608 | u32 subTexelPrecisionBits /// num bits of subtexel precision |
| 2609 | u32 mipmapPrecisionBits /// num bits of mipmap precision |
| 2610 | |
| 2611 | u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices) |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 2612 | u32 maxDrawIndirectCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2613 | |
| 2614 | f32 maxSamplerLodBias /// max absolute sampler level of detail bias |
| 2615 | f32 maxSamplerAnisotropy /// max degree of sampler anisotropy |
| 2616 | |
| 2617 | u32 maxViewports /// max number of active viewports |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2618 | u32[2] maxViewportDimensions /// max viewport dimensions (x,y) |
| 2619 | f32[2] viewportBoundsRange /// viewport bounds range (min,max) |
| 2620 | u32 viewportSubPixelBits /// num bits of subpixel precision for viewport |
| 2621 | |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 2622 | platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes) |
| 2623 | VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes) |
| 2624 | VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes) |
| 2625 | VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2626 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2627 | s32 minTexelOffset /// min texel offset for OpTextureSampleOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2628 | u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2629 | s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2630 | u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset |
| 2631 | f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset |
| 2632 | f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset |
| 2633 | u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset |
| 2634 | |
| 2635 | u32 maxFramebufferWidth /// max width for a framebuffer |
| 2636 | u32 maxFramebufferHeight /// max height for a framebuffer |
| 2637 | u32 maxFramebufferLayers /// max layer count for a layered framebuffer |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2638 | VkSampleCountFlags framebufferColorSampleCounts |
| 2639 | VkSampleCountFlags framebufferDepthSampleCounts |
| 2640 | VkSampleCountFlags framebufferStencilSampleCounts |
| 2641 | VkSampleCountFlags framebufferNoAttachmentSampleCounts |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2642 | u32 maxColorAttachments /// max num of framebuffer color attachments |
| 2643 | |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2644 | VkSampleCountFlags sampledImageColorSampleCounts |
| 2645 | VkSampleCountFlags sampledImageIntegerSampleCounts |
| 2646 | VkSampleCountFlags sampledImageDepthSampleCounts |
| 2647 | VkSampleCountFlags sampledImageStencilSampleCounts |
| 2648 | VkSampleCountFlags storageImageSampleCounts |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2649 | u32 maxSampleMaskWords /// max num of sample mask words |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2650 | VkBool32 timestampComputeAndGraphics |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2651 | |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2652 | f32 timestampPeriod |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2653 | |
| 2654 | u32 maxClipDistances /// max number of clip distances |
| 2655 | u32 maxCullDistances /// max number of cull distances |
| 2656 | u32 maxCombinedClipAndCullDistances /// max combined number of user clipping |
| 2657 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2658 | u32 discreteQueuePriorities |
| 2659 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2660 | f32[2] pointSizeRange /// range (min,max) of supported point sizes |
| 2661 | f32[2] lineWidthRange /// range (min,max) of supported line widths |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2662 | f32 pointSizeGranularity /// granularity of supported point sizes |
| 2663 | f32 lineWidthGranularity /// granularity of supported line widths |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2664 | VkBool32 strictLines |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2665 | VkBool32 standardSampleLocations |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2666 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2667 | VkDeviceSize optimalBufferCopyOffsetAlignment |
| 2668 | VkDeviceSize optimalBufferCopyRowPitchAlignment |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 2669 | VkDeviceSize nonCoherentAtomSize |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2670 | } |
| 2671 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2672 | class VkPhysicalDeviceSparseProperties { |
| 2673 | VkBool32 residencyStandard2DBlockShape /// Sparse resources support: GPU will access all 2D (single sample) sparse resources using the standard block shapes (based on pixel format) |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2674 | VkBool32 residencyStandard2DMultisampleBlockShape /// Sparse resources support: GPU will access all 2D (multisample) sparse resources using the standard block shapes (based on pixel format) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2675 | VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format) |
| 2676 | 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 Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2677 | 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 |
| 2678 | } |
| 2679 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2680 | class VkSemaphoreCreateInfo { |
| 2681 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO |
| 2682 | const void* pNext /// Pointer to next structure |
| 2683 | VkSemaphoreCreateFlags flags /// Semaphore creation flags |
| 2684 | } |
| 2685 | |
| 2686 | class VkQueryPoolCreateInfo { |
| 2687 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO |
| 2688 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2689 | VkQueryPoolCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2690 | VkQueryType queryType |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2691 | u32 queryCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2692 | VkQueryPipelineStatisticFlags pipelineStatistics /// Optional |
| 2693 | } |
| 2694 | |
| 2695 | class VkFramebufferCreateInfo { |
| 2696 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO |
| 2697 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2698 | VkFramebufferCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2699 | VkRenderPass renderPass |
| 2700 | u32 attachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2701 | const VkImageView* pAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2702 | u32 width |
| 2703 | u32 height |
| 2704 | u32 layers |
| 2705 | } |
| 2706 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2707 | class VkDrawIndirectCommand { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2708 | u32 vertexCount |
| 2709 | u32 instanceCount |
| 2710 | u32 firstVertex |
| 2711 | u32 firstInstance |
| 2712 | } |
| 2713 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2714 | class VkDrawIndexedIndirectCommand { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2715 | u32 indexCount |
| 2716 | u32 instanceCount |
| 2717 | u32 firstIndex |
| 2718 | s32 vertexOffset |
| 2719 | u32 firstInstance |
| 2720 | } |
| 2721 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2722 | class VkDispatchIndirectCommand { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2723 | u32 x |
| 2724 | u32 y |
| 2725 | u32 z |
| 2726 | } |
| 2727 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2728 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2729 | class VkSurfaceCapabilitiesKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2730 | u32 minImageCount |
| 2731 | u32 maxImageCount |
| 2732 | VkExtent2D currentExtent |
| 2733 | VkExtent2D minImageExtent |
| 2734 | VkExtent2D maxImageExtent |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2735 | u32 maxImageArrayLayers |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2736 | VkSurfaceTransformFlagsKHR supportedTransforms |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2737 | VkSurfaceTransformFlagBitsKHR currentTransform |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2738 | VkCompositeAlphaFlagsKHR supportedCompositeAlpha |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2739 | VkImageUsageFlags supportedUsageFlags |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2740 | } |
| 2741 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2742 | @extension("VK_KHR_surface") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2743 | class VkSurfaceFormatKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2744 | VkFormat format |
| 2745 | VkColorSpaceKHR colorSpace |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2746 | } |
| 2747 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2748 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2749 | class VkSwapchainCreateInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2750 | VkStructureType sType |
| 2751 | const void* pNext |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2752 | VkSwapchainCreateFlagsKHR flags |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2753 | VkSurfaceKHR surface |
| 2754 | u32 minImageCount |
| 2755 | VkFormat imageFormat |
| 2756 | VkColorSpaceKHR imageColorSpace |
| 2757 | VkExtent2D imageExtent |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2758 | u32 imageArrayLayers |
| 2759 | VkImageUsageFlags imageUsage |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2760 | VkSharingMode sharingMode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2761 | u32 queueFamilyIndexCount |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2762 | const u32* pQueueFamilyIndices |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2763 | VkSurfaceTransformFlagBitsKHR preTransform |
| 2764 | VkCompositeAlphaFlagBitsKHR compositeAlpha |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2765 | VkPresentModeKHR presentMode |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2766 | VkBool32 clipped |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2767 | VkSwapchainKHR oldSwapchain |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2768 | } |
| 2769 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2770 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2771 | class VkPresentInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2772 | VkStructureType sType |
| 2773 | const void* pNext |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2774 | u32 waitSemaphoreCount |
| 2775 | const VkSemaphore* pWaitSemaphores |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2776 | u32 swapchainCount |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2777 | const VkSwapchainKHR* pSwapchains |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2778 | const u32* pImageIndices |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 2779 | VkResult* pResults |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2780 | } |
| 2781 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2782 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2783 | class VkDisplayPropertiesKHR { |
| 2784 | VkDisplayKHR display |
| 2785 | const char* displayName |
| 2786 | VkExtent2D physicalDimensions |
| 2787 | VkExtent2D physicalResolution |
| 2788 | VkSurfaceTransformFlagsKHR supportedTransforms |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2789 | VkBool32 planeReorderPossible |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2790 | VkBool32 persistentContent |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2791 | } |
| 2792 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2793 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2794 | class VkDisplayModeParametersKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2795 | VkExtent2D visibleRegion |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2796 | u32 refreshRate |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2797 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2798 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2799 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2800 | class VkDisplayModePropertiesKHR { |
| 2801 | VkDisplayModeKHR displayMode |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2802 | VkDisplayModeParametersKHR parameters |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2803 | } |
| 2804 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2805 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2806 | class VkDisplayModeCreateInfoKHR { |
| 2807 | VkStructureType sType |
| 2808 | const void* pNext |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 2809 | VkDisplayModeCreateFlagsKHR flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2810 | VkDisplayModeParametersKHR parameters |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2811 | } |
| 2812 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2813 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2814 | class VkDisplayPlanePropertiesKHR { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2815 | VkDisplayKHR currentDisplay |
| 2816 | u32 currentStackIndex |
| 2817 | } |
| 2818 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2819 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2820 | class VkDisplayPlaneCapabilitiesKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2821 | VkDisplayPlaneAlphaFlagsKHR supportedAlpha |
| 2822 | VkOffset2D minSrcPosition |
| 2823 | VkOffset2D maxSrcPosition |
| 2824 | VkExtent2D minSrcExtent |
| 2825 | VkExtent2D maxSrcExtent |
| 2826 | VkOffset2D minDstPosition |
| 2827 | VkOffset2D maxDstPosition |
| 2828 | VkExtent2D minDstExtent |
| 2829 | VkExtent2D maxDstExtent |
| 2830 | } |
| 2831 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2832 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2833 | class VkDisplaySurfaceCreateInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2834 | VkStructureType sType |
| 2835 | const void* pNext |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2836 | VkDisplaySurfaceCreateFlagsKHR flags |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2837 | VkDisplayModeKHR displayMode |
| 2838 | u32 planeIndex |
| 2839 | u32 planeStackIndex |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2840 | VkSurfaceTransformFlagBitsKHR transform |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2841 | f32 globalAlpha |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2842 | VkDisplayPlaneAlphaFlagBitsKHR alphaMode |
| 2843 | VkExtent2D imageExtent |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2844 | } |
| 2845 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2846 | @extension("VK_KHR_display_swapchain") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2847 | class VkDisplayPresentInfoKHR { |
| 2848 | VkStructureType sType |
| 2849 | const void* pNext |
| 2850 | VkRect2D srcRect |
| 2851 | VkRect2D dstRect |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2852 | VkBool32 persistent |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2853 | } |
| 2854 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2855 | @extension("VK_KHR_xlib_surface") |
| 2856 | class VkXlibSurfaceCreateInfoKHR { |
| 2857 | VkStructureType sType |
| 2858 | const void* pNext |
| 2859 | VkXlibSurfaceCreateFlagsKHR flags |
| 2860 | platform.Display* dpy |
| 2861 | platform.Window window |
| 2862 | } |
| 2863 | |
| 2864 | @extension("VK_KHR_xcb_surface") |
| 2865 | class VkXcbSurfaceCreateInfoKHR { |
| 2866 | VkStructureType sType |
| 2867 | const void* pNext |
| 2868 | VkXcbSurfaceCreateFlagsKHR flags |
| 2869 | platform.xcb_connection_t* connection |
| 2870 | platform.xcb_window_t window |
| 2871 | } |
| 2872 | |
| 2873 | @extension("VK_KHR_wayland_surface") |
| 2874 | class VkWaylandSurfaceCreateInfoKHR { |
| 2875 | VkStructureType sType |
| 2876 | const void* pNext |
| 2877 | VkWaylandSurfaceCreateFlagsKHR flags |
| 2878 | platform.wl_display* display |
| 2879 | platform.wl_surface* surface |
| 2880 | } |
| 2881 | |
| 2882 | @extension("VK_KHR_mir_surface") |
| 2883 | class VkMirSurfaceCreateInfoKHR { |
| 2884 | VkStructureType sType |
| 2885 | const void* pNext |
| 2886 | VkMirSurfaceCreateFlagsKHR flags |
| 2887 | platform.MirConnection* connection |
| 2888 | platform.MirSurface* mirSurface |
| 2889 | } |
| 2890 | |
| 2891 | @extension("VK_KHR_android_surface") |
| 2892 | class VkAndroidSurfaceCreateInfoKHR { |
| 2893 | VkStructureType sType |
| 2894 | const void* pNext |
| 2895 | VkAndroidSurfaceCreateFlagsKHR flags |
| 2896 | platform.ANativeWindow* window |
| 2897 | } |
| 2898 | |
| 2899 | @extension("VK_KHR_win32_surface") |
| 2900 | class VkWin32SurfaceCreateInfoKHR { |
| 2901 | VkStructureType sType |
| 2902 | const void* pNext |
| 2903 | VkWin32SurfaceCreateFlagsKHR flags |
| 2904 | platform.HINSTANCE hinstance |
| 2905 | platform.HWND hwnd |
| 2906 | } |
| 2907 | |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 2908 | @extension("VK_ANDROID_native_buffer") |
| 2909 | class VkNativeBufferANDROID { |
| 2910 | VkStructureType sType |
| 2911 | const void* pNext |
| 2912 | platform.buffer_handle_t handle |
| 2913 | int stride |
| 2914 | int format |
| 2915 | int usage |
| 2916 | } |
| 2917 | |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 2918 | @extension("VK_ANDROID_native_buffer") |
| 2919 | class VkSwapchainImageCreateInfoANDROID { |
| 2920 | VkStructureType sType |
| 2921 | const void* pNext |
Chris Forbes | 134d958 | 2017-01-12 14:26:37 +1300 | [diff] [blame] | 2922 | VkSwapchainImageUsageFlagsANDROID flags |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 2923 | } |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 2924 | |
| 2925 | @extension("VK_GOOGLE_display_timing") |
| 2926 | class VkRefreshCycleDurationGOOGLE { |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 2927 | u64 minRefreshDuration |
| 2928 | u64 maxRefreshDuration |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 2929 | } |
| 2930 | |
| 2931 | @extension("VK_GOOGLE_display_timing") |
| 2932 | class VkPastPresentationTimingGOOGLE { |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 2933 | u32 presentID |
| 2934 | u64 desiredPresentTime |
| 2935 | u64 actualPresentTime |
| 2936 | u64 earliestPresentTime |
| 2937 | u64 presentMargin |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 2938 | } |
| 2939 | |
| 2940 | @extension("VK_GOOGLE_display_timing") |
| 2941 | class VkPresentTimeGOOGLE { |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 2942 | u32 presentID |
| 2943 | u64 desiredPresentTime |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 2944 | } |
| 2945 | |
| 2946 | @extension("VK_GOOGLE_display_timing") |
| 2947 | class VkPresentTimesInfoGOOGLE { |
| 2948 | VkStructureType sType |
| 2949 | const void* pNext |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 2950 | u32 swapchainCount |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 2951 | const VkPresentTimeGOOGLE* pTimes |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 2952 | } |
| 2953 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 2954 | @extension("VK_EXT_debug_report") |
| 2955 | class VkDebugReportCallbackCreateInfoEXT { |
| 2956 | VkStructureType sType |
| 2957 | const void* pNext |
| 2958 | VkDebugReportFlagsEXT flags |
| 2959 | PFN_vkDebugReportCallbackEXT pfnCallback |
| 2960 | void* pUserData |
| 2961 | } |
| 2962 | |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 2963 | @extension("VK_AMD_rasterization_order") |
| 2964 | class VkPipelineRasterizationStateRasterizationOrderAMD { |
| 2965 | VkStructureType sType |
| 2966 | const void* pNext |
| 2967 | VkRasterizationOrderAMD rasterizationOrder |
| 2968 | } |
| 2969 | |
| 2970 | @extension("VK_EXT_debug_marker") |
| 2971 | class VkDebugMarkerObjectNameInfoEXT { |
| 2972 | VkStructureType sType |
| 2973 | const void* pNext |
| 2974 | VkDebugReportObjectTypeEXT objectType |
| 2975 | u64 object |
| 2976 | const char* pObjectName |
| 2977 | } |
| 2978 | |
| 2979 | @extension("VK_EXT_debug_marker") |
| 2980 | class VkDebugMarkerObjectTagInfoEXT { |
| 2981 | VkStructureType sType |
| 2982 | const void* pNext |
| 2983 | VkDebugReportObjectTypeEXT objectType |
| 2984 | u64 object |
| 2985 | u64 tagName |
| 2986 | platform.size_t tagSize |
| 2987 | const void* pTag |
| 2988 | } |
| 2989 | |
| 2990 | @extension("VK_EXT_debug_marker") |
| 2991 | class VkDebugMarkerMarkerInfoEXT { |
| 2992 | VkStructureType sType |
| 2993 | const void* pNext |
| 2994 | const char* pMarkerName |
| 2995 | f32[4] color |
| 2996 | } |
| 2997 | |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 2998 | @extension("VK_NV_dedicated_allocation") |
| 2999 | class VkDedicatedAllocationImageCreateInfoNV { |
| 3000 | VkStructureType sType |
| 3001 | const void* pNext |
| 3002 | VkBool32 dedicatedAllocation |
| 3003 | } |
| 3004 | |
| 3005 | @extension("VK_NV_dedicated_allocation") |
| 3006 | class VkDedicatedAllocationBufferCreateInfoNV { |
| 3007 | VkStructureType sType |
| 3008 | const void* pNext |
| 3009 | VkBool32 dedicatedAllocation |
| 3010 | } |
| 3011 | |
| 3012 | @extension("VK_NV_dedicated_allocation") |
| 3013 | class VkDedicatedAllocationMemoryAllocateInfoNV { |
| 3014 | VkStructureType sType |
| 3015 | const void* pNext |
| 3016 | VkImage image |
| 3017 | VkBuffer buffer |
| 3018 | } |
| 3019 | |
Chris Forbes | 1194ede | 2016-12-30 16:29:25 +1300 | [diff] [blame] | 3020 | @extension("VK_KHR_get_physical_device_properties2") |
| 3021 | class VkPhysicalDeviceFeatures2KHR { |
| 3022 | VkStructureType sType |
| 3023 | void* pNext |
| 3024 | VkPhysicalDeviceFeatures features |
| 3025 | } |
| 3026 | |
| 3027 | @extension("VK_KHR_get_physical_device_properties2") |
| 3028 | class VkPhysicalDeviceProperties2KHR { |
| 3029 | VkStructureType sType |
| 3030 | void* pNext |
| 3031 | VkPhysicalDeviceProperties properties |
| 3032 | } |
| 3033 | |
| 3034 | @extension("VK_KHR_get_physical_device_properties2") |
| 3035 | class VkFormatProperties2KHR { |
| 3036 | VkStructureType sType |
| 3037 | void* pNext |
| 3038 | VkFormatProperties formatProperties |
| 3039 | } |
| 3040 | |
| 3041 | @extension("VK_KHR_get_physical_device_properties2") |
| 3042 | class VkImageFormatProperties2KHR { |
| 3043 | VkStructureType sType |
| 3044 | void* pNext |
| 3045 | VkImageFormatProperties imageFormatProperties |
| 3046 | } |
| 3047 | |
| 3048 | @extension("VK_KHR_get_physical_device_properties2") |
| 3049 | class VkPhysicalDeviceImageFormatInfo2KHR { |
| 3050 | VkStructureType sType |
| 3051 | const void* pNext |
| 3052 | VkFormat format |
| 3053 | VkImageType type |
| 3054 | VkImageTiling tiling |
| 3055 | VkImageUsageFlags usage |
| 3056 | VkImageCreateFlags flags |
| 3057 | } |
| 3058 | |
| 3059 | @extension("VK_KHR_get_physical_device_properties2") |
| 3060 | class VkQueueFamilyProperties2KHR { |
| 3061 | VkStructureType sType |
| 3062 | void* pNext |
| 3063 | VkQueueFamilyProperties queueFamilyProperties |
| 3064 | } |
| 3065 | |
| 3066 | @extension("VK_KHR_get_physical_device_properties2") |
| 3067 | class VkPhysicalDeviceMemoryProperties2KHR { |
| 3068 | VkStructureType sType |
| 3069 | void* pNext |
| 3070 | VkPhysicalDeviceMemoryProperties memoryProperties |
| 3071 | } |
| 3072 | |
| 3073 | @extension("VK_KHR_get_physical_device_properties2") |
| 3074 | class VkSparseImageFormatProperties2KHR { |
| 3075 | VkStructureType sType |
| 3076 | void* pNext |
| 3077 | VkSparseImageFormatProperties properties |
| 3078 | } |
| 3079 | |
| 3080 | @extension("VK_KHR_get_physical_device_properties2") |
| 3081 | class VkPhysicalDeviceSparseImageFormatInfo2KHR { |
| 3082 | VkStructureType sType |
| 3083 | const void* pNext |
| 3084 | VkFormat format |
| 3085 | VkImageType type |
| 3086 | VkSampleCountFlagBits samples |
| 3087 | VkImageUsageFlags usage |
| 3088 | VkImageTiling tiling |
| 3089 | } |
| 3090 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 3091 | @extension("VK_KHR_incremental_present") |
| 3092 | class VkRectLayerKHR { |
| 3093 | VkOffset2D offset |
| 3094 | VkExtent2D extent |
| 3095 | u32 layer |
| 3096 | } |
| 3097 | |
| 3098 | @extension("VK_KHR_incremental_present") |
| 3099 | class VkPresentRegionKHR { |
| 3100 | u32 rectangleCount |
| 3101 | const VkRectLayerKHR* pRectangles |
| 3102 | } |
| 3103 | |
| 3104 | @extension("VK_KHR_incremental_present") |
| 3105 | class VkPresentRegionsKHR { |
| 3106 | VkStructureType sType |
| 3107 | const void* pNext |
| 3108 | u32 swapchainCount |
| 3109 | const VkPresentRegionKHR* pRegions |
| 3110 | } |
| 3111 | |
| 3112 | @extension("VK_NV_external_memory_capabilities") |
| 3113 | class VkExternalImageFormatPropertiesNV { |
| 3114 | VkImageFormatProperties imageFormatProperties |
| 3115 | VkExternalMemoryFeatureFlagsNV externalMemoryFeatures |
| 3116 | VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes |
| 3117 | VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes |
| 3118 | } |
| 3119 | |
| 3120 | @extension("VK_NV_external_memory") |
| 3121 | class VkExternalMemoryImageCreateInfoNV { |
| 3122 | VkStructureType sType |
| 3123 | const void* pNext |
| 3124 | VkExternalMemoryHandleTypeFlagsNV handleTypes |
| 3125 | } |
| 3126 | |
| 3127 | @extension("VK_NV_external_memory") |
| 3128 | class VkExportMemoryAllocateInfoNV { |
| 3129 | VkStructureType sType |
| 3130 | const void* pNext |
| 3131 | VkExternalMemoryHandleTypeFlagsNV handleTypes |
| 3132 | } |
| 3133 | |
| 3134 | @extension("VK_NV_external_memory_win32") |
| 3135 | class VkImportMemoryWin32HandleInfoNV { |
| 3136 | VkStructureType sType |
| 3137 | const void* pNext |
| 3138 | VkExternalMemoryHandleTypeFlagsNV handleType |
| 3139 | platform.HANDLE handle |
| 3140 | } |
| 3141 | |
| 3142 | @extension("VK_NV_external_memory_win32") |
| 3143 | class VkExportMemoryWin32HandleInfoNV { |
| 3144 | VkStructureType sType |
| 3145 | const void* pNext |
| 3146 | const platform.SECURITY_ATTRIBUTES* pAttributes |
| 3147 | u32 dwAccess |
| 3148 | } |
| 3149 | |
| 3150 | @extension("VK_NV_win32_keyed_mutex") |
| 3151 | class VkWin32KeyedMutexAcquireReleaseInfoNV { |
| 3152 | VkStructureType sType |
| 3153 | const void* pNext |
| 3154 | u32 acquireCount |
| 3155 | const VkDeviceMemory* pAcquireSyncs |
| 3156 | const u64* pAcquireKeys |
| 3157 | const u32* pAcquireTimeoutMilliseconds |
| 3158 | u32 releaseCount |
| 3159 | const VkDeviceMemory* pReleaseSyncs |
| 3160 | const u64* pReleaseKeys |
| 3161 | } |
| 3162 | |
| 3163 | @extension("VK_EXT_validation_flags") |
| 3164 | class VkValidationFlagsEXT { |
| 3165 | VkStructureType sType |
| 3166 | const void* pNext |
| 3167 | u32 disabledValidationCheckCount |
| 3168 | VkValidationCheckEXT* pDisabledValidationChecks |
| 3169 | } |
| 3170 | |
| 3171 | @extension("VK_NVX_device_generated_commands") |
| 3172 | class VkDeviceGeneratedCommandsFeaturesNVX { |
| 3173 | VkStructureType sType |
| 3174 | const void* pNext |
| 3175 | VkBool32 computeBindingPointSupport |
| 3176 | } |
| 3177 | |
| 3178 | @extension("VK_NVX_device_generated_commands") |
| 3179 | class VkDeviceGeneratedCommandsLimitsNVX { |
| 3180 | VkStructureType sType |
| 3181 | const void* pNext |
| 3182 | u32 maxIndirectCommandsLayoutTokenCount |
| 3183 | u32 maxObjectEntryCounts |
| 3184 | u32 minSequenceCountBufferOffsetAlignment |
| 3185 | u32 minSequenceIndexBufferOffsetAlignment |
| 3186 | u32 minCommandsTokenBufferOffsetAlignment |
| 3187 | } |
| 3188 | |
| 3189 | @extension("VK_NVX_device_generated_commands") |
| 3190 | class VkIndirectCommandsTokenNVX { |
| 3191 | VkIndirectCommandsTokenTypeNVX tokenType |
| 3192 | VkBuffer buffer |
| 3193 | VkDeviceSize offset |
| 3194 | } |
| 3195 | |
| 3196 | @extension("VK_NVX_device_generated_commands") |
| 3197 | class VkIndirectCommandsLayoutTokenNVX { |
| 3198 | VkIndirectCommandsTokenTypeNVX tokenType |
| 3199 | u32 bindingUnit |
| 3200 | u32 dynamicCount |
| 3201 | u32 divisor |
| 3202 | } |
| 3203 | |
| 3204 | @extension("VK_NVX_device_generated_commands") |
| 3205 | class VkIndirectCommandsLayoutCreateInfoNVX { |
| 3206 | VkStructureType sType |
| 3207 | const void* pNext |
| 3208 | VkPipelineBindPoint pipelineBindPoint |
| 3209 | VkIndirectCommandsLayoutUsageFlagsNVX flags |
| 3210 | u32 tokenCount |
| 3211 | const VkIndirectCommandsLayoutTokenNVX* pTokens |
| 3212 | } |
| 3213 | |
| 3214 | @extension("VK_NVX_device_generated_commands") |
| 3215 | class VkCmdProcessCommandsInfoNVX { |
| 3216 | VkStructureType sType |
| 3217 | const void* pNext |
| 3218 | VkObjectTableNVX objectTable |
| 3219 | VkIndirectCommandsLayoutNVX indirectCommandsLayout |
| 3220 | u32 indirectCommandsTokenCount |
| 3221 | const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens |
| 3222 | u32 maxSequencesCount |
| 3223 | VkCommandBuffer targetCommandBuffer |
| 3224 | VkBuffer sequencesCountBuffer |
| 3225 | VkDeviceSize sequencesCountOffset |
| 3226 | VkBuffer sequencesIndexBuffer |
| 3227 | VkDeviceSize sequencesIndexOffset |
| 3228 | } |
| 3229 | |
| 3230 | @extension("VK_NVX_device_generated_commands") |
| 3231 | class VkCmdReserveSpaceForCommandsInfoNVX { |
| 3232 | VkStructureType sType |
| 3233 | const void* pNext |
| 3234 | VkObjectTableNVX objectTable |
| 3235 | VkIndirectCommandsLayoutNVX indirectCommandsLayout |
| 3236 | u32 maxSequencesCount |
| 3237 | } |
| 3238 | |
| 3239 | @extension("VK_NVX_device_generated_commands") |
| 3240 | class VkObjectTableCreateInfoNVX { |
| 3241 | VkStructureType sType |
| 3242 | const void* pNext |
| 3243 | u32 objectCount |
| 3244 | const VkObjectEntryTypeNVX* pObjectEntryTypes |
| 3245 | const u32* pObjectEntryCounts |
| 3246 | const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags |
| 3247 | u32 maxUniformBuffersPerDescriptor |
| 3248 | u32 maxStorageBuffersPerDescriptor |
| 3249 | u32 maxStorageImagesPerDescriptor |
| 3250 | u32 maxSampledImagesPerDescriptor |
| 3251 | u32 maxPipelineLayouts |
| 3252 | } |
| 3253 | |
| 3254 | @extension("VK_NVX_device_generated_commands") |
| 3255 | class VkObjectTableEntryNVX { |
| 3256 | VkObjectEntryTypeNVX type |
| 3257 | VkObjectEntryUsageFlagsNVX flags |
| 3258 | } |
| 3259 | |
| 3260 | @extension("VK_NVX_device_generated_commands") |
| 3261 | class VkObjectTablePipelineEntryNVX { |
| 3262 | VkObjectEntryTypeNVX type |
| 3263 | VkObjectEntryUsageFlagsNVX flags |
| 3264 | VkPipeline pipeline |
| 3265 | } |
| 3266 | |
| 3267 | @extension("VK_NVX_device_generated_commands") |
| 3268 | class VkObjectTableDescriptorSetEntryNVX { |
| 3269 | VkObjectEntryTypeNVX type |
| 3270 | VkObjectEntryUsageFlagsNVX flags |
| 3271 | VkPipelineLayout pipelineLayout |
| 3272 | VkDescriptorSet descriptorSet |
| 3273 | } |
| 3274 | |
| 3275 | @extension("VK_NVX_device_generated_commands") |
| 3276 | class VkObjectTableVertexBufferEntryNVX { |
| 3277 | VkObjectEntryTypeNVX type |
| 3278 | VkObjectEntryUsageFlagsNVX flags |
| 3279 | VkBuffer buffer |
| 3280 | } |
| 3281 | |
| 3282 | @extension("VK_NVX_device_generated_commands") |
| 3283 | class VkObjectTableIndexBufferEntryNVX { |
| 3284 | VkObjectEntryTypeNVX type |
| 3285 | VkObjectEntryUsageFlagsNVX flags |
| 3286 | VkBuffer buffer |
| 3287 | } |
| 3288 | |
| 3289 | @extension("VK_NVX_device_generated_commands") |
| 3290 | class VkObjectTablePushConstantEntryNVX { |
| 3291 | VkObjectEntryTypeNVX type |
| 3292 | VkObjectEntryUsageFlagsNVX flags |
| 3293 | VkPipelineLayout pipelineLayout |
| 3294 | VkShaderStageFlags stageFlags |
| 3295 | } |
| 3296 | |
| 3297 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 3298 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3299 | //////////////// |
| 3300 | // Commands // |
| 3301 | //////////////// |
| 3302 | |
| 3303 | // Function pointers. TODO: add support for function pointers. |
| 3304 | |
| 3305 | @external type void* PFN_vkVoidFunction |
| 3306 | @pfn cmd void vkVoidFunction() { |
| 3307 | } |
| 3308 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3309 | @external type void* PFN_vkAllocationFunction |
| 3310 | @pfn cmd void* vkAllocationFunction( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3311 | void* pUserData, |
| 3312 | platform.size_t size, |
| 3313 | platform.size_t alignment, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3314 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3315 | return ? |
| 3316 | } |
| 3317 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3318 | @external type void* PFN_vkReallocationFunction |
| 3319 | @pfn cmd void* vkReallocationFunction( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3320 | void* pUserData, |
| 3321 | void* pOriginal, |
| 3322 | platform.size_t size, |
| 3323 | platform.size_t alignment, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3324 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3325 | return ? |
| 3326 | } |
| 3327 | |
| 3328 | @external type void* PFN_vkFreeFunction |
| 3329 | @pfn cmd void vkFreeFunction( |
| 3330 | void* pUserData, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3331 | void* pMemory) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3332 | } |
| 3333 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3334 | @external type void* PFN_vkInternalAllocationNotification |
| 3335 | @pfn cmd void vkInternalAllocationNotification( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3336 | void* pUserData, |
| 3337 | platform.size_t size, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3338 | VkInternalAllocationType allocationType, |
| 3339 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3340 | } |
| 3341 | |
| 3342 | @external type void* PFN_vkInternalFreeNotification |
| 3343 | @pfn cmd void vkInternalFreeNotification( |
| 3344 | void* pUserData, |
| 3345 | platform.size_t size, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3346 | VkInternalAllocationType allocationType, |
| 3347 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3348 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3349 | |
| 3350 | // Global functions |
| 3351 | |
| 3352 | @threadSafety("system") |
| 3353 | cmd VkResult vkCreateInstance( |
| 3354 | const VkInstanceCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3355 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3356 | VkInstance* pInstance) { |
| 3357 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO) |
| 3358 | |
| 3359 | instance := ? |
| 3360 | pInstance[0] = instance |
| 3361 | State.Instances[instance] = new!InstanceObject() |
| 3362 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 3363 | layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount] |
| 3364 | extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3365 | |
| 3366 | return ? |
| 3367 | } |
| 3368 | |
| 3369 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3370 | cmd void vkDestroyInstance( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3371 | VkInstance instance, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3372 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3373 | instanceObject := GetInstance(instance) |
| 3374 | |
| 3375 | State.Instances[instance] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3376 | } |
| 3377 | |
| 3378 | @threadSafety("system") |
| 3379 | cmd VkResult vkEnumeratePhysicalDevices( |
| 3380 | VkInstance instance, |
| 3381 | u32* pPhysicalDeviceCount, |
| 3382 | VkPhysicalDevice* pPhysicalDevices) { |
| 3383 | instanceObject := GetInstance(instance) |
| 3384 | |
| 3385 | physicalDeviceCount := as!u32(?) |
| 3386 | pPhysicalDeviceCount[0] = physicalDeviceCount |
| 3387 | physicalDevices := pPhysicalDevices[0:physicalDeviceCount] |
| 3388 | |
| 3389 | for i in (0 .. physicalDeviceCount) { |
| 3390 | physicalDevice := ? |
| 3391 | physicalDevices[i] = physicalDevice |
| 3392 | if !(physicalDevice in State.PhysicalDevices) { |
| 3393 | State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance) |
| 3394 | } |
| 3395 | } |
| 3396 | |
| 3397 | return ? |
| 3398 | } |
| 3399 | |
| 3400 | cmd PFN_vkVoidFunction vkGetDeviceProcAddr( |
| 3401 | VkDevice device, |
| 3402 | const char* pName) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3403 | if device != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3404 | device := GetDevice(device) |
| 3405 | } |
| 3406 | |
| 3407 | return ? |
| 3408 | } |
| 3409 | |
| 3410 | cmd PFN_vkVoidFunction vkGetInstanceProcAddr( |
| 3411 | VkInstance instance, |
| 3412 | const char* pName) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3413 | if instance != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3414 | instanceObject := GetInstance(instance) |
| 3415 | } |
| 3416 | |
| 3417 | return ? |
| 3418 | } |
| 3419 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3420 | cmd void vkGetPhysicalDeviceProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3421 | VkPhysicalDevice physicalDevice, |
| 3422 | VkPhysicalDeviceProperties* pProperties) { |
| 3423 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3424 | |
| 3425 | properties := ? |
| 3426 | pProperties[0] = properties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3427 | } |
| 3428 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3429 | cmd void vkGetPhysicalDeviceQueueFamilyProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3430 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3431 | u32* pQueueFamilyPropertyCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3432 | VkQueueFamilyProperties* pQueueFamilyProperties) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3433 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3434 | // TODO: Figure out how to express fetch-count-or-properties |
| 3435 | // This version fails 'apic validate' with 'fence not allowed in |
| 3436 | // *semantic.Branch'. Other attempts have failed with the same or other |
| 3437 | // errors. |
| 3438 | // if pQueueFamilyProperties != null { |
| 3439 | // queuesProperties := pQueueFamilyProperties[0:pCount[0]] |
| 3440 | // for i in (0 .. pCount[0]) { |
| 3441 | // queueProperties := as!VkQueueFamilyProperties(?) |
| 3442 | // queuesProperties[i] = queueProperties |
| 3443 | // } |
| 3444 | // } else { |
| 3445 | // count := ? |
| 3446 | // pCount[0] = count |
| 3447 | // } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3448 | } |
| 3449 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3450 | cmd void vkGetPhysicalDeviceMemoryProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3451 | VkPhysicalDevice physicalDevice, |
| 3452 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) { |
| 3453 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3454 | |
| 3455 | memoryProperties := ? |
| 3456 | pMemoryProperties[0] = memoryProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3457 | } |
| 3458 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3459 | cmd void vkGetPhysicalDeviceFeatures( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3460 | VkPhysicalDevice physicalDevice, |
| 3461 | VkPhysicalDeviceFeatures* pFeatures) { |
| 3462 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3463 | |
| 3464 | features := ? |
| 3465 | pFeatures[0] = features |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3466 | } |
| 3467 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3468 | cmd void vkGetPhysicalDeviceFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3469 | VkPhysicalDevice physicalDevice, |
| 3470 | VkFormat format, |
| 3471 | VkFormatProperties* pFormatProperties) { |
| 3472 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3473 | |
| 3474 | formatProperties := ? |
| 3475 | pFormatProperties[0] = formatProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3476 | } |
| 3477 | |
Jesse Hall | a9e5703 | 2015-11-30 01:03:10 -0800 | [diff] [blame] | 3478 | cmd VkResult vkGetPhysicalDeviceImageFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3479 | VkPhysicalDevice physicalDevice, |
| 3480 | VkFormat format, |
| 3481 | VkImageType type, |
| 3482 | VkImageTiling tiling, |
| 3483 | VkImageUsageFlags usage, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3484 | VkImageCreateFlags flags, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3485 | VkImageFormatProperties* pImageFormatProperties) { |
| 3486 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3487 | |
| 3488 | imageFormatProperties := ? |
| 3489 | pImageFormatProperties[0] = imageFormatProperties |
Jesse Hall | a9e5703 | 2015-11-30 01:03:10 -0800 | [diff] [blame] | 3490 | |
| 3491 | return ? |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3492 | } |
| 3493 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3494 | |
| 3495 | // Device functions |
| 3496 | |
| 3497 | @threadSafety("system") |
| 3498 | cmd VkResult vkCreateDevice( |
| 3499 | VkPhysicalDevice physicalDevice, |
| 3500 | const VkDeviceCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3501 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3502 | VkDevice* pDevice) { |
| 3503 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO) |
| 3504 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3505 | |
| 3506 | device := ? |
| 3507 | pDevice[0] = device |
| 3508 | State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice) |
| 3509 | |
| 3510 | return ? |
| 3511 | } |
| 3512 | |
| 3513 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3514 | cmd void vkDestroyDevice( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3515 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3516 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3517 | deviceObject := GetDevice(device) |
| 3518 | |
| 3519 | State.Devices[device] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3520 | } |
| 3521 | |
| 3522 | |
| 3523 | // Extension discovery functions |
| 3524 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3525 | cmd VkResult vkEnumerateInstanceLayerProperties( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3526 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3527 | VkLayerProperties* pProperties) { |
| 3528 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3529 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3530 | |
| 3531 | properties := pProperties[0:count] |
| 3532 | for i in (0 .. count) { |
| 3533 | property := ? |
| 3534 | properties[i] = property |
| 3535 | } |
| 3536 | |
| 3537 | return ? |
| 3538 | } |
| 3539 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3540 | cmd VkResult vkEnumerateInstanceExtensionProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3541 | const char* pLayerName, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3542 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3543 | VkExtensionProperties* pProperties) { |
| 3544 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3545 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3546 | |
| 3547 | properties := pProperties[0:count] |
| 3548 | for i in (0 .. count) { |
| 3549 | property := ? |
| 3550 | properties[i] = property |
| 3551 | } |
| 3552 | |
| 3553 | return ? |
| 3554 | } |
| 3555 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3556 | cmd VkResult vkEnumerateDeviceLayerProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3557 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3558 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3559 | VkLayerProperties* pProperties) { |
| 3560 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3561 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3562 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3563 | |
| 3564 | properties := pProperties[0:count] |
| 3565 | for i in (0 .. count) { |
| 3566 | property := ? |
| 3567 | properties[i] = property |
| 3568 | } |
| 3569 | |
| 3570 | return ? |
| 3571 | } |
| 3572 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3573 | cmd VkResult vkEnumerateDeviceExtensionProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3574 | VkPhysicalDevice physicalDevice, |
| 3575 | const char* pLayerName, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3576 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3577 | VkExtensionProperties* pProperties) { |
| 3578 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3579 | |
| 3580 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3581 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3582 | |
| 3583 | properties := pProperties[0:count] |
| 3584 | for i in (0 .. count) { |
| 3585 | property := ? |
| 3586 | properties[i] = property |
| 3587 | } |
| 3588 | |
| 3589 | return ? |
| 3590 | } |
| 3591 | |
| 3592 | |
| 3593 | // Queue functions |
| 3594 | |
| 3595 | @threadSafety("system") |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3596 | cmd void vkGetDeviceQueue( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3597 | VkDevice device, |
| 3598 | u32 queueFamilyIndex, |
| 3599 | u32 queueIndex, |
| 3600 | VkQueue* pQueue) { |
| 3601 | deviceObject := GetDevice(device) |
| 3602 | |
| 3603 | queue := ? |
| 3604 | pQueue[0] = queue |
| 3605 | |
| 3606 | if !(queue in State.Queues) { |
| 3607 | State.Queues[queue] = new!QueueObject(device: device) |
| 3608 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3609 | } |
| 3610 | |
| 3611 | @threadSafety("app") |
| 3612 | cmd VkResult vkQueueSubmit( |
| 3613 | VkQueue queue, |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 3614 | u32 submitCount, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 3615 | const VkSubmitInfo* pSubmits, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3616 | VkFence fence) { |
| 3617 | queueObject := GetQueue(queue) |
| 3618 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3619 | if fence != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3620 | fenceObject := GetFence(fence) |
| 3621 | assert(fenceObject.device == queueObject.device) |
| 3622 | } |
| 3623 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3624 | // commandBuffers := pcommandBuffers[0:commandBufferCount] |
| 3625 | // for i in (0 .. commandBufferCount) { |
| 3626 | // commandBuffer := commandBuffers[i] |
| 3627 | // commandBufferObject := GetCommandBuffer(commandBuffer) |
| 3628 | // assert(commandBufferObject.device == queueObject.device) |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 3629 | // |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3630 | // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags, |
| 3631 | // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.") |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 3632 | // } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3633 | |
| 3634 | return ? |
| 3635 | } |
| 3636 | |
| 3637 | @threadSafety("system") |
| 3638 | cmd VkResult vkQueueWaitIdle( |
| 3639 | VkQueue queue) { |
| 3640 | queueObject := GetQueue(queue) |
| 3641 | |
| 3642 | return ? |
| 3643 | } |
| 3644 | |
| 3645 | @threadSafety("system") |
| 3646 | cmd VkResult vkDeviceWaitIdle( |
| 3647 | VkDevice device) { |
| 3648 | deviceObject := GetDevice(device) |
| 3649 | |
| 3650 | return ? |
| 3651 | } |
| 3652 | |
| 3653 | |
| 3654 | // Memory functions |
| 3655 | |
| 3656 | @threadSafety("system") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3657 | cmd VkResult vkAllocateMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3658 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3659 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 3660 | const VkAllocationCallbacks* pAllocator, |
| 3661 | VkDeviceMemory* pMemory) { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 3662 | assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3663 | deviceObject := GetDevice(device) |
| 3664 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3665 | memory := ? |
| 3666 | pMemory[0] = memory |
| 3667 | State.DeviceMemories[memory] = new!DeviceMemoryObject( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3668 | device: device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3669 | allocationSize: pAllocateInfo[0].allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3670 | |
| 3671 | return ? |
| 3672 | } |
| 3673 | |
| 3674 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3675 | cmd void vkFreeMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3676 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3677 | VkDeviceMemory memory, |
| 3678 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3679 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3680 | memoryObject := GetDeviceMemory(memory) |
| 3681 | assert(memoryObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3682 | |
| 3683 | // Check that no objects are still bound before freeing. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3684 | validate("MemoryCheck", len(memoryObject.boundObjects) == 0, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3685 | "vkFreeMemory: objects still bound") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3686 | validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0, |
| 3687 | "vkFreeMemory: commandBuffers still bound") |
| 3688 | State.DeviceMemories[memory] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3689 | } |
| 3690 | |
| 3691 | @threadSafety("app") |
| 3692 | cmd VkResult vkMapMemory( |
| 3693 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3694 | VkDeviceMemory memory, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3695 | VkDeviceSize offset, |
| 3696 | VkDeviceSize size, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3697 | VkMemoryMapFlags flags, |
| 3698 | void** ppData) { |
| 3699 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3700 | memoryObject := GetDeviceMemory(memory) |
| 3701 | assert(memoryObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3702 | |
| 3703 | assert(flags == as!VkMemoryMapFlags(0)) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3704 | assert((offset + size) <= memoryObject.allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3705 | |
| 3706 | return ? |
| 3707 | } |
| 3708 | |
| 3709 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3710 | cmd void vkUnmapMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3711 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3712 | VkDeviceMemory memory) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3713 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3714 | memoryObject := GetDeviceMemory(memory) |
| 3715 | assert(memoryObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3716 | } |
| 3717 | |
| 3718 | cmd VkResult vkFlushMappedMemoryRanges( |
| 3719 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3720 | u32 memoryRangeCount |
| 3721 | const VkMappedMemoryRange* pMemoryRanges) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3722 | deviceObject := GetDevice(device) |
| 3723 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3724 | memoryRanges := pMemoryRanges[0:memoryRangeCount] |
| 3725 | for i in (0 .. memoryRangeCount) { |
| 3726 | memoryRange := memoryRanges[i] |
| 3727 | memoryObject := GetDeviceMemory(memoryRange.memory) |
| 3728 | assert(memoryObject.device == device) |
| 3729 | assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3730 | } |
| 3731 | |
| 3732 | return ? |
| 3733 | } |
| 3734 | |
| 3735 | cmd VkResult vkInvalidateMappedMemoryRanges( |
| 3736 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3737 | u32 memoryRangeCount, |
| 3738 | const VkMappedMemoryRange* pMemoryRanges) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3739 | deviceObject := GetDevice(device) |
| 3740 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3741 | memoryRanges := pMemoryRanges[0:memoryRangeCount] |
| 3742 | for i in (0 .. memoryRangeCount) { |
| 3743 | memoryRange := memoryRanges[i] |
| 3744 | memoryObject := GetDeviceMemory(memoryRange.memory) |
| 3745 | assert(memoryObject.device == device) |
| 3746 | assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3747 | } |
| 3748 | |
| 3749 | return ? |
| 3750 | } |
| 3751 | |
| 3752 | |
| 3753 | // Memory management API functions |
| 3754 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3755 | cmd void vkGetDeviceMemoryCommitment( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3756 | VkDevice device, |
| 3757 | VkDeviceMemory memory, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3758 | VkDeviceSize* pCommittedMemoryInBytes) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3759 | deviceObject := GetDevice(device) |
| 3760 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3761 | if memory != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3762 | memoryObject := GetDeviceMemory(memory) |
| 3763 | assert(memoryObject.device == device) |
| 3764 | } |
| 3765 | |
| 3766 | committedMemoryInBytes := ? |
| 3767 | pCommittedMemoryInBytes[0] = committedMemoryInBytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3768 | } |
| 3769 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3770 | cmd void vkGetBufferMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3771 | VkDevice device, |
| 3772 | VkBuffer buffer, |
| 3773 | VkMemoryRequirements* pMemoryRequirements) { |
| 3774 | deviceObject := GetDevice(device) |
| 3775 | bufferObject := GetBuffer(buffer) |
| 3776 | assert(bufferObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3777 | } |
| 3778 | |
| 3779 | cmd VkResult vkBindBufferMemory( |
| 3780 | VkDevice device, |
| 3781 | VkBuffer buffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3782 | VkDeviceMemory memory, |
| 3783 | VkDeviceSize memoryOffset) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3784 | deviceObject := GetDevice(device) |
| 3785 | bufferObject := GetBuffer(buffer) |
| 3786 | assert(bufferObject.device == device) |
| 3787 | |
| 3788 | // Unbind buffer from previous memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3789 | if bufferObject.memory != NULL_HANDLE { |
| 3790 | memoryObject := GetDeviceMemory(bufferObject.memory) |
| 3791 | memoryObject.boundObjects[as!u64(buffer)] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3792 | } |
| 3793 | |
| 3794 | // Bind buffer to given memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3795 | if memory != NULL_HANDLE { |
| 3796 | memoryObject := GetDeviceMemory(memory) |
| 3797 | assert(memoryObject.device == device) |
| 3798 | memoryObject.boundObjects[as!u64(buffer)] = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3799 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3800 | bufferObject.memory = memory |
| 3801 | bufferObject.memoryOffset = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3802 | |
| 3803 | return ? |
| 3804 | } |
| 3805 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3806 | cmd void vkGetImageMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3807 | VkDevice device, |
| 3808 | VkImage image, |
| 3809 | VkMemoryRequirements* pMemoryRequirements) { |
| 3810 | deviceObject := GetDevice(device) |
| 3811 | imageObject := GetImage(image) |
| 3812 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3813 | } |
| 3814 | |
| 3815 | cmd VkResult vkBindImageMemory( |
| 3816 | VkDevice device, |
| 3817 | VkImage image, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3818 | VkDeviceMemory memory, |
| 3819 | VkDeviceSize memoryOffset) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3820 | deviceObject := GetDevice(device) |
| 3821 | imageObject := GetImage(image) |
| 3822 | assert(imageObject.device == device) |
| 3823 | |
| 3824 | // Unbind image from previous memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3825 | if imageObject.memory != NULL_HANDLE { |
| 3826 | memoryObject := GetDeviceMemory(imageObject.memory) |
| 3827 | memoryObject.boundObjects[as!u64(image)] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3828 | } |
| 3829 | |
| 3830 | // Bind image to given memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3831 | if memory != NULL_HANDLE { |
| 3832 | memoryObject := GetDeviceMemory(memory) |
| 3833 | assert(memoryObject.device == device) |
| 3834 | memoryObject.boundObjects[as!u64(image)] = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3835 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3836 | imageObject.memory = memory |
| 3837 | imageObject.memoryOffset = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3838 | |
| 3839 | return ? |
| 3840 | } |
| 3841 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3842 | cmd void vkGetImageSparseMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3843 | VkDevice device, |
| 3844 | VkImage image, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3845 | u32* pSparseMemoryRequirementCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3846 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { |
| 3847 | deviceObject := GetDevice(device) |
| 3848 | imageObject := GetImage(image) |
| 3849 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3850 | } |
| 3851 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3852 | cmd void vkGetPhysicalDeviceSparseImageFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3853 | VkPhysicalDevice physicalDevice, |
| 3854 | VkFormat format, |
| 3855 | VkImageType type, |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 3856 | VkSampleCountFlagBits samples, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3857 | VkImageUsageFlags usage, |
| 3858 | VkImageTiling tiling, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3859 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3860 | VkSparseImageFormatProperties* pProperties) { |
| 3861 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3862 | } |
| 3863 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 3864 | cmd VkResult vkQueueBindSparse( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3865 | VkQueue queue, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3866 | u32 bindInfoCount, |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 3867 | const VkBindSparseInfo* pBindInfo, |
| 3868 | VkFence fence) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3869 | queueObject := GetQueue(queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3870 | |
| 3871 | return ? |
| 3872 | } |
| 3873 | |
| 3874 | |
| 3875 | // Fence functions |
| 3876 | |
| 3877 | @threadSafety("system") |
| 3878 | cmd VkResult vkCreateFence( |
| 3879 | VkDevice device, |
| 3880 | const VkFenceCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3881 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3882 | VkFence* pFence) { |
| 3883 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO) |
| 3884 | deviceObject := GetDevice(device) |
| 3885 | |
| 3886 | fence := ? |
| 3887 | pFence[0] = fence |
| 3888 | State.Fences[fence] = new!FenceObject( |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3889 | device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT))) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3890 | |
| 3891 | return ? |
| 3892 | } |
| 3893 | |
| 3894 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3895 | cmd void vkDestroyFence( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3896 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3897 | VkFence fence, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3898 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3899 | deviceObject := GetDevice(device) |
| 3900 | fenceObject := GetFence(fence) |
| 3901 | assert(fenceObject.device == device) |
| 3902 | |
| 3903 | State.Fences[fence] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3904 | } |
| 3905 | |
| 3906 | @threadSafety("system") |
| 3907 | cmd VkResult vkResetFences( |
| 3908 | VkDevice device, |
| 3909 | u32 fenceCount, |
| 3910 | const VkFence* pFences) { |
| 3911 | deviceObject := GetDevice(device) |
| 3912 | |
| 3913 | fences := pFences[0:fenceCount] |
| 3914 | for i in (0 .. fenceCount) { |
| 3915 | fence := fences[i] |
| 3916 | fenceObject := GetFence(fence) |
| 3917 | assert(fenceObject.device == device) |
| 3918 | fenceObject.signaled = false |
| 3919 | } |
| 3920 | |
| 3921 | return ? |
| 3922 | } |
| 3923 | |
| 3924 | @threadSafety("system") |
| 3925 | cmd VkResult vkGetFenceStatus( |
| 3926 | VkDevice device, |
| 3927 | VkFence fence) { |
| 3928 | deviceObject := GetDevice(device) |
| 3929 | fenceObject := GetFence(fence) |
| 3930 | assert(fenceObject.device == device) |
| 3931 | |
| 3932 | return ? |
| 3933 | } |
| 3934 | |
| 3935 | @threadSafety("system") |
| 3936 | cmd VkResult vkWaitForFences( |
| 3937 | VkDevice device, |
| 3938 | u32 fenceCount, |
| 3939 | const VkFence* pFences, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3940 | VkBool32 waitAll, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3941 | u64 timeout) { /// timeout in nanoseconds |
| 3942 | deviceObject := GetDevice(device) |
| 3943 | |
| 3944 | fences := pFences[0:fenceCount] |
| 3945 | for i in (0 .. fenceCount) { |
| 3946 | fence := fences[i] |
| 3947 | fenceObject := GetFence(fence) |
| 3948 | assert(fenceObject.device == device) |
| 3949 | } |
| 3950 | |
| 3951 | return ? |
| 3952 | } |
| 3953 | |
| 3954 | |
| 3955 | // Queue semaphore functions |
| 3956 | |
| 3957 | @threadSafety("system") |
| 3958 | cmd VkResult vkCreateSemaphore( |
| 3959 | VkDevice device, |
| 3960 | const VkSemaphoreCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3961 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3962 | VkSemaphore* pSemaphore) { |
| 3963 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO) |
| 3964 | deviceObject := GetDevice(device) |
| 3965 | |
| 3966 | semaphore := ? |
| 3967 | pSemaphore[0] = semaphore |
| 3968 | State.Semaphores[semaphore] = new!SemaphoreObject(device: device) |
| 3969 | |
| 3970 | return ? |
| 3971 | } |
| 3972 | |
| 3973 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3974 | cmd void vkDestroySemaphore( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3975 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3976 | VkSemaphore semaphore, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3977 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3978 | deviceObject := GetDevice(device) |
| 3979 | semaphoreObject := GetSemaphore(semaphore) |
| 3980 | assert(semaphoreObject.device == device) |
| 3981 | |
| 3982 | State.Semaphores[semaphore] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3983 | } |
| 3984 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3985 | |
| 3986 | // Event functions |
| 3987 | |
| 3988 | @threadSafety("system") |
| 3989 | cmd VkResult vkCreateEvent( |
| 3990 | VkDevice device, |
| 3991 | const VkEventCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3992 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3993 | VkEvent* pEvent) { |
| 3994 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO) |
| 3995 | deviceObject := GetDevice(device) |
| 3996 | |
| 3997 | event := ? |
| 3998 | pEvent[0] = event |
| 3999 | State.Events[event] = new!EventObject(device: device) |
| 4000 | |
| 4001 | return ? |
| 4002 | } |
| 4003 | |
| 4004 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4005 | cmd void vkDestroyEvent( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4006 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4007 | VkEvent event, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4008 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4009 | deviceObject := GetDevice(device) |
| 4010 | eventObject := GetEvent(event) |
| 4011 | assert(eventObject.device == device) |
| 4012 | |
| 4013 | State.Events[event] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4014 | } |
| 4015 | |
| 4016 | @threadSafety("system") |
| 4017 | cmd VkResult vkGetEventStatus( |
| 4018 | VkDevice device, |
| 4019 | VkEvent event) { |
| 4020 | deviceObject := GetDevice(device) |
| 4021 | eventObject := GetEvent(event) |
| 4022 | assert(eventObject.device == device) |
| 4023 | |
| 4024 | return ? |
| 4025 | } |
| 4026 | |
| 4027 | @threadSafety("system") |
| 4028 | cmd VkResult vkSetEvent( |
| 4029 | VkDevice device, |
| 4030 | VkEvent event) { |
| 4031 | deviceObject := GetDevice(device) |
| 4032 | eventObject := GetEvent(event) |
| 4033 | assert(eventObject.device == device) |
| 4034 | |
| 4035 | return ? |
| 4036 | } |
| 4037 | |
| 4038 | @threadSafety("system") |
| 4039 | cmd VkResult vkResetEvent( |
| 4040 | VkDevice device, |
| 4041 | VkEvent event) { |
| 4042 | deviceObject := GetDevice(device) |
| 4043 | eventObject := GetEvent(event) |
| 4044 | assert(eventObject.device == device) |
| 4045 | |
| 4046 | return ? |
| 4047 | } |
| 4048 | |
| 4049 | |
| 4050 | // Query functions |
| 4051 | |
| 4052 | @threadSafety("system") |
| 4053 | cmd VkResult vkCreateQueryPool( |
| 4054 | VkDevice device, |
| 4055 | const VkQueryPoolCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4056 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4057 | VkQueryPool* pQueryPool) { |
| 4058 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO) |
| 4059 | deviceObject := GetDevice(device) |
| 4060 | |
| 4061 | queryPool := ? |
| 4062 | pQueryPool[0] = queryPool |
| 4063 | State.QueryPools[queryPool] = new!QueryPoolObject(device: device) |
| 4064 | |
| 4065 | return ? |
| 4066 | } |
| 4067 | |
| 4068 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4069 | cmd void vkDestroyQueryPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4070 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4071 | VkQueryPool queryPool, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4072 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4073 | deviceObject := GetDevice(device) |
| 4074 | queryPoolObject := GetQueryPool(queryPool) |
| 4075 | assert(queryPoolObject.device == device) |
| 4076 | |
| 4077 | State.QueryPools[queryPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4078 | } |
| 4079 | |
| 4080 | @threadSafety("system") |
| 4081 | cmd VkResult vkGetQueryPoolResults( |
| 4082 | VkDevice device, |
| 4083 | VkQueryPool queryPool, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4084 | u32 firstQuery, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4085 | u32 queryCount, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4086 | platform.size_t dataSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4087 | void* pData, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4088 | VkDeviceSize stride, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4089 | VkQueryResultFlags flags) { |
| 4090 | deviceObject := GetDevice(device) |
| 4091 | queryPoolObject := GetQueryPool(queryPool) |
| 4092 | assert(queryPoolObject.device == device) |
| 4093 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4094 | data := pData[0:dataSize] |
| 4095 | |
| 4096 | return ? |
| 4097 | } |
| 4098 | |
| 4099 | // Buffer functions |
| 4100 | |
| 4101 | @threadSafety("system") |
| 4102 | cmd VkResult vkCreateBuffer( |
| 4103 | VkDevice device, |
| 4104 | const VkBufferCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4105 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4106 | VkBuffer* pBuffer) { |
| 4107 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO) |
| 4108 | deviceObject := GetDevice(device) |
| 4109 | |
| 4110 | buffer := ? |
| 4111 | pBuffer[0] = buffer |
| 4112 | State.Buffers[buffer] = new!BufferObject(device: device) |
| 4113 | |
| 4114 | return ? |
| 4115 | } |
| 4116 | |
| 4117 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4118 | cmd void vkDestroyBuffer( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4119 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4120 | VkBuffer buffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4121 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4122 | deviceObject := GetDevice(device) |
| 4123 | bufferObject := GetBuffer(buffer) |
| 4124 | assert(bufferObject.device == device) |
| 4125 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4126 | assert(bufferObject.memory == 0) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4127 | State.Buffers[buffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4128 | } |
| 4129 | |
| 4130 | |
| 4131 | // Buffer view functions |
| 4132 | |
| 4133 | @threadSafety("system") |
| 4134 | cmd VkResult vkCreateBufferView( |
| 4135 | VkDevice device, |
| 4136 | const VkBufferViewCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4137 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4138 | VkBufferView* pView) { |
| 4139 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO) |
| 4140 | deviceObject := GetDevice(device) |
| 4141 | |
| 4142 | bufferObject := GetBuffer(pCreateInfo.buffer) |
| 4143 | assert(bufferObject.device == device) |
| 4144 | |
| 4145 | view := ? |
| 4146 | pView[0] = view |
| 4147 | State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer) |
| 4148 | |
| 4149 | return ? |
| 4150 | } |
| 4151 | |
| 4152 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4153 | cmd void vkDestroyBufferView( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4154 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4155 | VkBufferView bufferView, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4156 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4157 | deviceObject := GetDevice(device) |
| 4158 | bufferViewObject := GetBufferView(bufferView) |
| 4159 | assert(bufferViewObject.device == device) |
| 4160 | |
| 4161 | State.BufferViews[bufferView] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4162 | } |
| 4163 | |
| 4164 | |
| 4165 | // Image functions |
| 4166 | |
| 4167 | @threadSafety("system") |
| 4168 | cmd VkResult vkCreateImage( |
| 4169 | VkDevice device, |
| 4170 | const VkImageCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4171 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4172 | VkImage* pImage) { |
| 4173 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO) |
| 4174 | deviceObject := GetDevice(device) |
| 4175 | |
| 4176 | image := ? |
| 4177 | pImage[0] = image |
| 4178 | State.Images[image] = new!ImageObject(device: device) |
| 4179 | |
| 4180 | return ? |
| 4181 | } |
| 4182 | |
| 4183 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4184 | cmd void vkDestroyImage( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4185 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4186 | VkImage image, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4187 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4188 | deviceObject := GetDevice(device) |
| 4189 | imageObject := GetImage(image) |
| 4190 | assert(imageObject.device == device) |
| 4191 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4192 | assert(imageObject.memory == 0) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4193 | State.Images[image] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4194 | } |
| 4195 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 4196 | cmd void vkGetImageSubresourceLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4197 | VkDevice device, |
| 4198 | VkImage image, |
| 4199 | const VkImageSubresource* pSubresource, |
| 4200 | VkSubresourceLayout* pLayout) { |
| 4201 | deviceObject := GetDevice(device) |
| 4202 | imageObject := GetImage(image) |
| 4203 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4204 | } |
| 4205 | |
| 4206 | |
| 4207 | // Image view functions |
| 4208 | |
| 4209 | @threadSafety("system") |
| 4210 | cmd VkResult vkCreateImageView( |
| 4211 | VkDevice device, |
| 4212 | const VkImageViewCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4213 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4214 | VkImageView* pView) { |
| 4215 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO) |
| 4216 | deviceObject := GetDevice(device) |
| 4217 | |
| 4218 | imageObject := GetImage(pCreateInfo.image) |
| 4219 | assert(imageObject.device == device) |
| 4220 | |
| 4221 | view := ? |
| 4222 | pView[0] = view |
| 4223 | State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image) |
| 4224 | |
| 4225 | return ? |
| 4226 | } |
| 4227 | |
| 4228 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4229 | cmd void vkDestroyImageView( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4230 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4231 | VkImageView imageView, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4232 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4233 | deviceObject := GetDevice(device) |
| 4234 | imageViewObject := GetImageView(imageView) |
| 4235 | assert(imageViewObject.device == device) |
| 4236 | |
| 4237 | State.ImageViews[imageView] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4238 | } |
| 4239 | |
| 4240 | |
| 4241 | // Shader functions |
| 4242 | |
| 4243 | cmd VkResult vkCreateShaderModule( |
| 4244 | VkDevice device, |
| 4245 | const VkShaderModuleCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4246 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4247 | VkShaderModule* pShaderModule) { |
| 4248 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO) |
| 4249 | deviceObject := GetDevice(device) |
| 4250 | |
| 4251 | shaderModule := ? |
| 4252 | pShaderModule[0] = shaderModule |
| 4253 | State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device) |
| 4254 | |
| 4255 | return ? |
| 4256 | } |
| 4257 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4258 | cmd void vkDestroyShaderModule( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4259 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4260 | VkShaderModule shaderModule, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4261 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4262 | deviceObject := GetDevice(device) |
| 4263 | shaderModuleObject := GetShaderModule(shaderModule) |
| 4264 | assert(shaderModuleObject.device == device) |
| 4265 | |
| 4266 | State.ShaderModules[shaderModule] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4267 | } |
| 4268 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4269 | |
| 4270 | // Pipeline functions |
| 4271 | |
| 4272 | cmd VkResult vkCreatePipelineCache( |
| 4273 | VkDevice device, |
| 4274 | const VkPipelineCacheCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4275 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4276 | VkPipelineCache* pPipelineCache) { |
| 4277 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO) |
| 4278 | deviceObject := GetDevice(device) |
| 4279 | |
| 4280 | pipelineCache := ? |
| 4281 | pPipelineCache[0] = pipelineCache |
| 4282 | State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device) |
| 4283 | |
| 4284 | return ? |
| 4285 | } |
| 4286 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4287 | cmd void vkDestroyPipelineCache( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4288 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4289 | VkPipelineCache pipelineCache, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4290 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4291 | deviceObject := GetDevice(device) |
| 4292 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 4293 | assert(pipelineCacheObject.device == device) |
| 4294 | |
| 4295 | State.PipelineCaches[pipelineCache] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4296 | } |
| 4297 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4298 | cmd VkResult vkGetPipelineCacheData( |
| 4299 | VkDevice device, |
| 4300 | VkPipelineCache pipelineCache, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4301 | platform.size_t* pDataSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4302 | void* pData) { |
| 4303 | deviceObject := GetDevice(device) |
| 4304 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 4305 | assert(pipelineCacheObject.device == device) |
| 4306 | |
| 4307 | return ? |
| 4308 | } |
| 4309 | |
| 4310 | cmd VkResult vkMergePipelineCaches( |
| 4311 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4312 | VkPipelineCache dstCache, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4313 | u32 srcCacheCount, |
| 4314 | const VkPipelineCache* pSrcCaches) { |
| 4315 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4316 | dstCacheObject := GetPipelineCache(dstCache) |
| 4317 | assert(dstCacheObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4318 | |
| 4319 | srcCaches := pSrcCaches[0:srcCacheCount] |
| 4320 | for i in (0 .. srcCacheCount) { |
| 4321 | srcCache := srcCaches[i] |
| 4322 | srcCacheObject := GetPipelineCache(srcCache) |
| 4323 | assert(srcCacheObject.device == device) |
| 4324 | } |
| 4325 | |
| 4326 | return ? |
| 4327 | } |
| 4328 | |
| 4329 | cmd VkResult vkCreateGraphicsPipelines( |
| 4330 | VkDevice device, |
| 4331 | VkPipelineCache pipelineCache, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4332 | u32 createInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4333 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4334 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4335 | VkPipeline* pPipelines) { |
| 4336 | deviceObject := GetDevice(device) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4337 | if pipelineCache != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4338 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 4339 | assert(pipelineCacheObject.device == device) |
| 4340 | } |
| 4341 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4342 | createInfos := pCreateInfos[0:createInfoCount] |
| 4343 | pipelines := pPipelines[0:createInfoCount] |
| 4344 | for i in (0 .. createInfoCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4345 | pipeline := ? |
| 4346 | pipelines[i] = pipeline |
| 4347 | State.Pipelines[pipeline] = new!PipelineObject(device: device) |
| 4348 | } |
| 4349 | |
| 4350 | return ? |
| 4351 | } |
| 4352 | |
| 4353 | cmd VkResult vkCreateComputePipelines( |
| 4354 | VkDevice device, |
| 4355 | VkPipelineCache pipelineCache, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4356 | u32 createInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4357 | const VkComputePipelineCreateInfo* pCreateInfos, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4358 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4359 | VkPipeline* pPipelines) { |
| 4360 | deviceObject := GetDevice(device) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4361 | if pipelineCache != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4362 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 4363 | assert(pipelineCacheObject.device == device) |
| 4364 | } |
| 4365 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4366 | createInfos := pCreateInfos[0:createInfoCount] |
| 4367 | pipelines := pPipelines[0:createInfoCount] |
| 4368 | for i in (0 .. createInfoCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4369 | pipeline := ? |
| 4370 | pipelines[i] = pipeline |
| 4371 | State.Pipelines[pipeline] = new!PipelineObject(device: device) |
| 4372 | } |
| 4373 | |
| 4374 | return ? |
| 4375 | } |
| 4376 | |
| 4377 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4378 | cmd void vkDestroyPipeline( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4379 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4380 | VkPipeline pipeline, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4381 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4382 | deviceObject := GetDevice(device) |
| 4383 | pipelineObjects := GetPipeline(pipeline) |
| 4384 | assert(pipelineObjects.device == device) |
| 4385 | |
| 4386 | State.Pipelines[pipeline] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4387 | } |
| 4388 | |
| 4389 | |
| 4390 | // Pipeline layout functions |
| 4391 | |
| 4392 | @threadSafety("system") |
| 4393 | cmd VkResult vkCreatePipelineLayout( |
| 4394 | VkDevice device, |
| 4395 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4396 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4397 | VkPipelineLayout* pPipelineLayout) { |
| 4398 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO) |
| 4399 | deviceObject := GetDevice(device) |
| 4400 | |
| 4401 | pipelineLayout := ? |
| 4402 | pPipelineLayout[0] = pipelineLayout |
| 4403 | State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device) |
| 4404 | |
| 4405 | return ? |
| 4406 | } |
| 4407 | |
| 4408 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4409 | cmd void vkDestroyPipelineLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4410 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4411 | VkPipelineLayout pipelineLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4412 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4413 | deviceObject := GetDevice(device) |
| 4414 | pipelineLayoutObjects := GetPipelineLayout(pipelineLayout) |
| 4415 | assert(pipelineLayoutObjects.device == device) |
| 4416 | |
| 4417 | State.PipelineLayouts[pipelineLayout] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4418 | } |
| 4419 | |
| 4420 | |
| 4421 | // Sampler functions |
| 4422 | |
| 4423 | @threadSafety("system") |
| 4424 | cmd VkResult vkCreateSampler( |
| 4425 | VkDevice device, |
| 4426 | const VkSamplerCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4427 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4428 | VkSampler* pSampler) { |
| 4429 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO) |
| 4430 | deviceObject := GetDevice(device) |
| 4431 | |
| 4432 | sampler := ? |
| 4433 | pSampler[0] = sampler |
| 4434 | State.Samplers[sampler] = new!SamplerObject(device: device) |
| 4435 | |
| 4436 | return ? |
| 4437 | } |
| 4438 | |
| 4439 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4440 | cmd void vkDestroySampler( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4441 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4442 | VkSampler sampler, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4443 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4444 | deviceObject := GetDevice(device) |
| 4445 | samplerObject := GetSampler(sampler) |
| 4446 | assert(samplerObject.device == device) |
| 4447 | |
| 4448 | State.Samplers[sampler] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4449 | } |
| 4450 | |
| 4451 | |
| 4452 | // Descriptor set functions |
| 4453 | |
| 4454 | @threadSafety("system") |
| 4455 | cmd VkResult vkCreateDescriptorSetLayout( |
| 4456 | VkDevice device, |
| 4457 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4458 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4459 | VkDescriptorSetLayout* pSetLayout) { |
| 4460 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO) |
| 4461 | deviceObject := GetDevice(device) |
| 4462 | |
| 4463 | setLayout := ? |
| 4464 | pSetLayout[0] = setLayout |
| 4465 | State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device) |
| 4466 | |
| 4467 | return ? |
| 4468 | } |
| 4469 | |
| 4470 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4471 | cmd void vkDestroyDescriptorSetLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4472 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4473 | VkDescriptorSetLayout descriptorSetLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4474 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4475 | deviceObject := GetDevice(device) |
| 4476 | descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout) |
| 4477 | assert(descriptorSetLayoutObject.device == device) |
| 4478 | |
| 4479 | State.DescriptorSetLayouts[descriptorSetLayout] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4480 | } |
| 4481 | |
| 4482 | @threadSafety("system") |
| 4483 | cmd VkResult vkCreateDescriptorPool( |
| 4484 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4485 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4486 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4487 | VkDescriptorPool* pDescriptorPool) { |
| 4488 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO) |
| 4489 | deviceObject := GetDevice(device) |
| 4490 | |
| 4491 | descriptorPool := ? |
| 4492 | pDescriptorPool[0] = descriptorPool |
| 4493 | State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device) |
| 4494 | |
| 4495 | return ? |
| 4496 | } |
| 4497 | |
| 4498 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4499 | cmd void vkDestroyDescriptorPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4500 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4501 | VkDescriptorPool descriptorPool, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4502 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4503 | deviceObject := GetDevice(device) |
| 4504 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 4505 | assert(descriptorPoolObject.device == device) |
| 4506 | |
| 4507 | State.DescriptorPools[descriptorPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4508 | } |
| 4509 | |
| 4510 | @threadSafety("app") |
| 4511 | cmd VkResult vkResetDescriptorPool( |
| 4512 | VkDevice device, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4513 | VkDescriptorPool descriptorPool, |
| 4514 | VkDescriptorPoolResetFlags flags) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4515 | deviceObject := GetDevice(device) |
| 4516 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 4517 | assert(descriptorPoolObject.device == device) |
| 4518 | |
| 4519 | return ? |
| 4520 | } |
| 4521 | |
| 4522 | @threadSafety("app") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4523 | cmd VkResult vkAllocateDescriptorSets( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4524 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4525 | const VkDescriptorSetAllocateInfo* pAllocateInfo, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4526 | VkDescriptorSet* pDescriptorSets) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4527 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4528 | allocInfo := pAllocateInfo[0] |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4529 | descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4530 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4531 | setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount] |
| 4532 | for i in (0 .. allocInfo.setCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4533 | setLayout := setLayouts[i] |
| 4534 | setLayoutObject := GetDescriptorSetLayout(setLayout) |
| 4535 | assert(setLayoutObject.device == device) |
| 4536 | } |
| 4537 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4538 | descriptorSets := pDescriptorSets[0:allocInfo.setCount] |
| 4539 | for i in (0 .. allocInfo.setCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4540 | descriptorSet := ? |
| 4541 | descriptorSets[i] = descriptorSet |
| 4542 | State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device) |
| 4543 | } |
| 4544 | |
| 4545 | return ? |
| 4546 | } |
| 4547 | |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 4548 | cmd VkResult vkFreeDescriptorSets( |
| 4549 | VkDevice device, |
| 4550 | VkDescriptorPool descriptorPool, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4551 | u32 descriptorSetCount, |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 4552 | const VkDescriptorSet* pDescriptorSets) { |
| 4553 | deviceObject := GetDevice(device) |
| 4554 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 4555 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4556 | descriptorSets := pDescriptorSets[0:descriptorSetCount] |
| 4557 | for i in (0 .. descriptorSetCount) { |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 4558 | descriptorSet := descriptorSets[i] |
| 4559 | descriptorSetObject := GetDescriptorSet(descriptorSet) |
| 4560 | assert(descriptorSetObject.device == device) |
| 4561 | State.DescriptorSets[descriptorSet] = null |
| 4562 | } |
| 4563 | |
| 4564 | return ? |
| 4565 | } |
| 4566 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4567 | cmd void vkUpdateDescriptorSets( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4568 | VkDevice device, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4569 | u32 descriptorWriteCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4570 | const VkWriteDescriptorSet* pDescriptorWrites, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4571 | u32 descriptorCopyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4572 | const VkCopyDescriptorSet* pDescriptorCopies) { |
| 4573 | deviceObject := GetDevice(device) |
| 4574 | |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4575 | descriptorWrites := pDescriptorWrites[0:descriptorWriteCount] |
| 4576 | for i in (0 .. descriptorWriteCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4577 | descriptorWrite := descriptorWrites[i] |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4578 | descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4579 | assert(descriptorWriteObject.device == device) |
| 4580 | } |
| 4581 | |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4582 | descriptorCopies := pDescriptorCopies[0:descriptorCopyCount] |
| 4583 | for i in (0 .. descriptorCopyCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4584 | descriptorCopy := descriptorCopies[i] |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4585 | descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4586 | assert(descriptorCopyObject.device == device) |
| 4587 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4588 | } |
| 4589 | |
| 4590 | |
| 4591 | // Framebuffer functions |
| 4592 | |
| 4593 | @threadSafety("system") |
| 4594 | cmd VkResult vkCreateFramebuffer( |
| 4595 | VkDevice device, |
| 4596 | const VkFramebufferCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4597 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4598 | VkFramebuffer* pFramebuffer) { |
| 4599 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO) |
| 4600 | deviceObject := GetDevice(device) |
| 4601 | |
| 4602 | framebuffer := ? |
| 4603 | pFramebuffer[0] = framebuffer |
| 4604 | State.Framebuffers[framebuffer] = new!FramebufferObject(device: device) |
| 4605 | |
| 4606 | return ? |
| 4607 | } |
| 4608 | |
| 4609 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4610 | cmd void vkDestroyFramebuffer( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4611 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4612 | VkFramebuffer framebuffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4613 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4614 | deviceObject := GetDevice(device) |
| 4615 | framebufferObject := GetFramebuffer(framebuffer) |
| 4616 | assert(framebufferObject.device == device) |
| 4617 | |
| 4618 | State.Framebuffers[framebuffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4619 | } |
| 4620 | |
| 4621 | |
| 4622 | // Renderpass functions |
| 4623 | |
| 4624 | @threadSafety("system") |
| 4625 | cmd VkResult vkCreateRenderPass( |
| 4626 | VkDevice device, |
| 4627 | const VkRenderPassCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4628 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4629 | VkRenderPass* pRenderPass) { |
| 4630 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO) |
| 4631 | deviceObject := GetDevice(device) |
| 4632 | |
| 4633 | renderpass := ? |
| 4634 | pRenderPass[0] = renderpass |
| 4635 | State.RenderPasses[renderpass] = new!RenderPassObject(device: device) |
| 4636 | |
| 4637 | return ? |
| 4638 | } |
| 4639 | |
| 4640 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4641 | cmd void vkDestroyRenderPass( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4642 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4643 | VkRenderPass renderPass, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4644 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4645 | deviceObject := GetDevice(device) |
| 4646 | renderPassObject := GetRenderPass(renderPass) |
| 4647 | assert(renderPassObject.device == device) |
| 4648 | |
| 4649 | State.RenderPasses[renderPass] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4650 | } |
| 4651 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 4652 | cmd void vkGetRenderAreaGranularity( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4653 | VkDevice device, |
| 4654 | VkRenderPass renderPass, |
| 4655 | VkExtent2D* pGranularity) { |
| 4656 | deviceObject := GetDevice(device) |
| 4657 | renderPassObject := GetRenderPass(renderPass) |
| 4658 | |
| 4659 | granularity := ? |
| 4660 | pGranularity[0] = granularity |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4661 | } |
| 4662 | |
| 4663 | // Command pool functions |
| 4664 | |
| 4665 | cmd VkResult vkCreateCommandPool( |
| 4666 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4667 | const VkCommandPoolCreateInfo* pCreateInfo, |
| 4668 | const VkAllocationCallbacks* pAllocator, |
| 4669 | VkCommandPool* pCommandPool) { |
| 4670 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4671 | deviceObject := GetDevice(device) |
| 4672 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4673 | commandPool := ? |
| 4674 | pCommandPool[0] = commandPool |
| 4675 | State.CommandPools[commandPool] = new!CommandPoolObject(device: device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4676 | |
| 4677 | return ? |
| 4678 | } |
| 4679 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4680 | cmd void vkDestroyCommandPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4681 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4682 | VkCommandPool commandPool, |
| 4683 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4684 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4685 | commandPoolObject := GetCommandPool(commandPool) |
| 4686 | assert(commandPoolObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4687 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4688 | State.CommandPools[commandPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4689 | } |
| 4690 | |
| 4691 | cmd VkResult vkResetCommandPool( |
| 4692 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4693 | VkCommandPool commandPool, |
| 4694 | VkCommandPoolResetFlags flags) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4695 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4696 | commandPoolObject := GetCommandPool(commandPool) |
| 4697 | assert(commandPoolObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4698 | |
| 4699 | return ? |
| 4700 | } |
| 4701 | |
| 4702 | // Command buffer functions |
| 4703 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4704 | macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) { |
| 4705 | memoryObject := GetDeviceMemory(memory) |
| 4706 | memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4707 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4708 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4709 | commandBufferObject.boundObjects[as!u64(obj)] = memory |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4710 | } |
| 4711 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4712 | macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) { |
| 4713 | memoryObject := GetDeviceMemory(memory) |
| 4714 | memoryObject.boundCommandBuffers[commandBuffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4715 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4716 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4717 | commandBufferObject.boundObjects[as!u64(obj)] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4718 | } |
| 4719 | |
| 4720 | @threadSafety("system") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4721 | cmd VkResult vkAllocateCommandBuffers( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4722 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4723 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 4724 | VkCommandBuffer* pCommandBuffers) { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 4725 | assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4726 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 4727 | count := pAllocateInfo[0].commandBufferCount |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4728 | commandBuffers := pCommandBuffers[0:count] |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4729 | for i in (0 .. count) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4730 | commandBuffer := ? |
| 4731 | commandBuffers[i] = commandBuffer |
| 4732 | State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4733 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4734 | |
| 4735 | return ? |
| 4736 | } |
| 4737 | |
| 4738 | @threadSafety("system") |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4739 | cmd void vkFreeCommandBuffers( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4740 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4741 | VkCommandPool commandPool, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4742 | u32 commandBufferCount, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4743 | const VkCommandBuffer* pCommandBuffers) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4744 | deviceObject := GetDevice(device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4745 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4746 | commandBuffers := pCommandBuffers[0:commandBufferCount] |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4747 | for i in (0 .. commandBufferCount) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4748 | commandBufferObject := GetCommandBuffer(commandBuffers[i]) |
| 4749 | assert(commandBufferObject.device == device) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4750 | // TODO: iterate over boundObjects and clear memory bindings |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4751 | State.CommandBuffers[commandBuffers[i]] = null |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4752 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4753 | } |
| 4754 | |
| 4755 | @threadSafety("app") |
| 4756 | cmd VkResult vkBeginCommandBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4757 | VkCommandBuffer commandBuffer, |
| 4758 | const VkCommandBufferBeginInfo* pBeginInfo) { |
| 4759 | assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO) |
| 4760 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4761 | |
| 4762 | // TODO: iterate over boundObjects and clear memory bindings |
| 4763 | |
| 4764 | return ? |
| 4765 | } |
| 4766 | |
| 4767 | @threadSafety("app") |
| 4768 | cmd VkResult vkEndCommandBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4769 | VkCommandBuffer commandBuffer) { |
| 4770 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4771 | |
| 4772 | return ? |
| 4773 | } |
| 4774 | |
| 4775 | @threadSafety("app") |
| 4776 | cmd VkResult vkResetCommandBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4777 | VkCommandBuffer commandBuffer, |
| 4778 | VkCommandBufferResetFlags flags) { |
| 4779 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4780 | |
| 4781 | // TODO: iterate over boundObjects and clear memory bindings |
| 4782 | |
| 4783 | return ? |
| 4784 | } |
| 4785 | |
| 4786 | |
| 4787 | // Command buffer building functions |
| 4788 | |
| 4789 | @threadSafety("app") |
| 4790 | cmd void vkCmdBindPipeline( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4791 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4792 | VkPipelineBindPoint pipelineBindPoint, |
| 4793 | VkPipeline pipeline) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4794 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4795 | pipelineObject := GetPipeline(pipeline) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4796 | assert(commandBufferObject.device == pipelineObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4797 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4798 | queue := switch (pipelineBindPoint) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4799 | case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT |
| 4800 | case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT |
| 4801 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4802 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4803 | } |
| 4804 | |
| 4805 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4806 | cmd void vkCmdSetViewport( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4807 | VkCommandBuffer commandBuffer, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4808 | u32 firstViewport, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4809 | u32 viewportCount, |
| 4810 | const VkViewport* pViewports) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4811 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4812 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4813 | } |
| 4814 | |
| 4815 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4816 | cmd void vkCmdSetScissor( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4817 | VkCommandBuffer commandBuffer, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4818 | u32 firstScissor, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4819 | u32 scissorCount, |
| 4820 | const VkRect2D* pScissors) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4821 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4822 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4823 | } |
| 4824 | |
| 4825 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4826 | cmd void vkCmdSetLineWidth( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4827 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4828 | f32 lineWidth) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4829 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4830 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4831 | } |
| 4832 | |
| 4833 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4834 | cmd void vkCmdSetDepthBias( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4835 | VkCommandBuffer commandBuffer, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4836 | f32 depthBiasConstantFactor, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4837 | f32 depthBiasClamp, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4838 | f32 depthBiasSlopeFactor) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4839 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4840 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4841 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4842 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4843 | @threadSafety("app") |
| 4844 | cmd void vkCmdSetBlendConstants( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4845 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4846 | // TODO(jessehall): apic only supports 'const' on pointer types. Using |
| 4847 | // an annotation as a quick hack to pass this to the template without |
| 4848 | // having to modify the AST and semantic model. |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4849 | @readonly f32[4] blendConstants) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4850 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4851 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4852 | } |
| 4853 | |
| 4854 | @threadSafety("app") |
| 4855 | cmd void vkCmdSetDepthBounds( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4856 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4857 | f32 minDepthBounds, |
| 4858 | f32 maxDepthBounds) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4859 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4860 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4861 | } |
| 4862 | |
| 4863 | @threadSafety("app") |
| 4864 | cmd void vkCmdSetStencilCompareMask( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4865 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4866 | VkStencilFaceFlags faceMask, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4867 | u32 compareMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4868 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4869 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4870 | } |
| 4871 | |
| 4872 | @threadSafety("app") |
| 4873 | cmd void vkCmdSetStencilWriteMask( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4874 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4875 | VkStencilFaceFlags faceMask, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4876 | u32 writeMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4877 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4878 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4879 | } |
| 4880 | |
| 4881 | @threadSafety("app") |
| 4882 | cmd void vkCmdSetStencilReference( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4883 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4884 | VkStencilFaceFlags faceMask, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4885 | u32 reference) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4886 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4887 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4888 | } |
| 4889 | |
| 4890 | @threadSafety("app") |
| 4891 | cmd void vkCmdBindDescriptorSets( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4892 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4893 | VkPipelineBindPoint pipelineBindPoint, |
| 4894 | VkPipelineLayout layout, |
| 4895 | u32 firstSet, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4896 | u32 descriptorSetCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4897 | const VkDescriptorSet* pDescriptorSets, |
| 4898 | u32 dynamicOffsetCount, |
| 4899 | const u32* pDynamicOffsets) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4900 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4901 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4902 | descriptorSets := pDescriptorSets[0:descriptorSetCount] |
| 4903 | for i in (0 .. descriptorSetCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4904 | descriptorSet := descriptorSets[i] |
| 4905 | descriptorSetObject := GetDescriptorSet(descriptorSet) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4906 | assert(commandBufferObject.device == descriptorSetObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4907 | } |
| 4908 | |
| 4909 | dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount] |
| 4910 | for i in (0 .. dynamicOffsetCount) { |
| 4911 | dynamicOffset := dynamicOffsets[i] |
| 4912 | } |
| 4913 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4914 | queue := switch (pipelineBindPoint) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4915 | case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT |
| 4916 | case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT |
| 4917 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4918 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4919 | } |
| 4920 | |
| 4921 | @threadSafety("app") |
| 4922 | cmd void vkCmdBindIndexBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4923 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4924 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4925 | VkDeviceSize offset, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4926 | VkIndexType indexType) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4927 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4928 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4929 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4930 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4931 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4932 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4933 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4934 | } |
| 4935 | |
| 4936 | @threadSafety("app") |
| 4937 | cmd void vkCmdBindVertexBuffers( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4938 | VkCommandBuffer commandBuffer, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4939 | u32 firstBinding, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4940 | u32 bindingCount, |
| 4941 | const VkBuffer* pBuffers, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4942 | const VkDeviceSize* pOffsets) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4943 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4944 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4945 | // TODO: check if not [firstBinding:firstBinding+bindingCount] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4946 | buffers := pBuffers[0:bindingCount] |
| 4947 | offsets := pOffsets[0:bindingCount] |
| 4948 | for i in (0 .. bindingCount) { |
| 4949 | buffer := buffers[i] |
| 4950 | offset := offsets[i] |
| 4951 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4952 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4953 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4954 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4955 | } |
| 4956 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4957 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4958 | } |
| 4959 | |
| 4960 | @threadSafety("app") |
| 4961 | cmd void vkCmdDraw( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4962 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4963 | u32 vertexCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4964 | u32 instanceCount, |
| 4965 | u32 firstVertex, |
| 4966 | u32 firstInstance) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4967 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4968 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4969 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4970 | } |
| 4971 | |
| 4972 | @threadSafety("app") |
| 4973 | cmd void vkCmdDrawIndexed( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4974 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4975 | u32 indexCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4976 | u32 instanceCount, |
| 4977 | u32 firstIndex, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4978 | s32 vertexOffset, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4979 | u32 firstInstance) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4980 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4981 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4982 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4983 | } |
| 4984 | |
| 4985 | @threadSafety("app") |
| 4986 | cmd void vkCmdDrawIndirect( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4987 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4988 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4989 | VkDeviceSize offset, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4990 | u32 drawCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4991 | u32 stride) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4992 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4993 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4994 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4995 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4996 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4997 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4998 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4999 | } |
| 5000 | |
| 5001 | @threadSafety("app") |
| 5002 | cmd void vkCmdDrawIndexedIndirect( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5003 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5004 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 5005 | VkDeviceSize offset, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5006 | u32 drawCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5007 | u32 stride) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5008 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5009 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5010 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5011 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5012 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5013 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5014 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5015 | } |
| 5016 | |
| 5017 | @threadSafety("app") |
| 5018 | cmd void vkCmdDispatch( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5019 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5020 | u32 x, |
| 5021 | u32 y, |
| 5022 | u32 z) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5023 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5024 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5025 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5026 | } |
| 5027 | |
| 5028 | @threadSafety("app") |
| 5029 | cmd void vkCmdDispatchIndirect( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5030 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5031 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 5032 | VkDeviceSize offset) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5033 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5034 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5035 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5036 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5037 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5038 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5039 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5040 | } |
| 5041 | |
| 5042 | @threadSafety("app") |
| 5043 | cmd void vkCmdCopyBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5044 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5045 | VkBuffer srcBuffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5046 | VkBuffer dstBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5047 | u32 regionCount, |
| 5048 | const VkBufferCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5049 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5050 | srcBufferObject := GetBuffer(srcBuffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5051 | dstBufferObject := GetBuffer(dstBuffer) |
| 5052 | assert(commandBufferObject.device == srcBufferObject.device) |
| 5053 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5054 | |
| 5055 | regions := pRegions[0:regionCount] |
| 5056 | for i in (0 .. regionCount) { |
| 5057 | region := regions[i] |
| 5058 | } |
| 5059 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5060 | bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory) |
| 5061 | bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5062 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5063 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5064 | } |
| 5065 | |
| 5066 | @threadSafety("app") |
| 5067 | cmd void vkCmdCopyImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5068 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5069 | VkImage srcImage, |
| 5070 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5071 | VkImage dstImage, |
| 5072 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5073 | u32 regionCount, |
| 5074 | const VkImageCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5075 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5076 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5077 | dstImageObject := GetImage(dstImage) |
| 5078 | assert(commandBufferObject.device == srcImageObject.device) |
| 5079 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5080 | |
| 5081 | regions := pRegions[0:regionCount] |
| 5082 | for i in (0 .. regionCount) { |
| 5083 | region := regions[i] |
| 5084 | } |
| 5085 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5086 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 5087 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5088 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5089 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5090 | } |
| 5091 | |
| 5092 | @threadSafety("app") |
| 5093 | cmd void vkCmdBlitImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5094 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5095 | VkImage srcImage, |
| 5096 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5097 | VkImage dstImage, |
| 5098 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5099 | u32 regionCount, |
| 5100 | const VkImageBlit* pRegions, |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 5101 | VkFilter filter) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5102 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5103 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5104 | dstImageObject := GetImage(dstImage) |
| 5105 | assert(commandBufferObject.device == srcImageObject.device) |
| 5106 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5107 | |
| 5108 | regions := pRegions[0:regionCount] |
| 5109 | for i in (0 .. regionCount) { |
| 5110 | region := regions[i] |
| 5111 | } |
| 5112 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5113 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 5114 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5115 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5116 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5117 | } |
| 5118 | |
| 5119 | @threadSafety("app") |
| 5120 | cmd void vkCmdCopyBufferToImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5121 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5122 | VkBuffer srcBuffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5123 | VkImage dstImage, |
| 5124 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5125 | u32 regionCount, |
| 5126 | const VkBufferImageCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5127 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5128 | srcBufferObject := GetBuffer(srcBuffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5129 | dstImageObject := GetImage(dstImage) |
| 5130 | assert(commandBufferObject.device == srcBufferObject.device) |
| 5131 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5132 | |
| 5133 | regions := pRegions[0:regionCount] |
| 5134 | for i in (0 .. regionCount) { |
| 5135 | region := regions[i] |
| 5136 | } |
| 5137 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5138 | bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory) |
| 5139 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5140 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5141 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5142 | } |
| 5143 | |
| 5144 | @threadSafety("app") |
| 5145 | cmd void vkCmdCopyImageToBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5146 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5147 | VkImage srcImage, |
| 5148 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5149 | VkBuffer dstBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5150 | u32 regionCount, |
| 5151 | const VkBufferImageCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5152 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5153 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5154 | dstBufferObject := GetBuffer(dstBuffer) |
| 5155 | assert(commandBufferObject.device == srcImageObject.device) |
| 5156 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5157 | |
| 5158 | regions := pRegions[0:regionCount] |
| 5159 | for i in (0 .. regionCount) { |
| 5160 | region := regions[i] |
| 5161 | } |
| 5162 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5163 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 5164 | bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5165 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5166 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5167 | } |
| 5168 | |
| 5169 | @threadSafety("app") |
| 5170 | cmd void vkCmdUpdateBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5171 | VkCommandBuffer commandBuffer, |
| 5172 | VkBuffer dstBuffer, |
| 5173 | VkDeviceSize dstOffset, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 5174 | VkDeviceSize dataSize, |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 5175 | const void* pData) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5176 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 5177 | dstBufferObject := GetBuffer(dstBuffer) |
| 5178 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5179 | |
| 5180 | data := pData[0:dataSize] |
| 5181 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5182 | bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5183 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5184 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5185 | } |
| 5186 | |
| 5187 | @threadSafety("app") |
| 5188 | cmd void vkCmdFillBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5189 | VkCommandBuffer commandBuffer, |
| 5190 | VkBuffer dstBuffer, |
| 5191 | VkDeviceSize dstOffset, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5192 | VkDeviceSize size, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5193 | u32 data) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5194 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 5195 | dstBufferObject := GetBuffer(dstBuffer) |
| 5196 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5197 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5198 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5199 | } |
| 5200 | |
| 5201 | @threadSafety("app") |
| 5202 | cmd void vkCmdClearColorImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5203 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5204 | VkImage image, |
| 5205 | VkImageLayout imageLayout, |
| 5206 | const VkClearColorValue* pColor, |
| 5207 | u32 rangeCount, |
| 5208 | const VkImageSubresourceRange* pRanges) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5209 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5210 | imageObject := GetImage(image) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5211 | assert(commandBufferObject.device == imageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5212 | |
| 5213 | ranges := pRanges[0:rangeCount] |
| 5214 | for i in (0 .. rangeCount) { |
| 5215 | range := ranges[i] |
| 5216 | } |
| 5217 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5218 | bindCommandBuffer(commandBuffer, image, imageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5219 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5220 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5221 | } |
| 5222 | |
| 5223 | @threadSafety("app") |
| 5224 | cmd void vkCmdClearDepthStencilImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5225 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5226 | VkImage image, |
| 5227 | VkImageLayout imageLayout, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 5228 | const VkClearDepthStencilValue* pDepthStencil, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5229 | u32 rangeCount, |
| 5230 | const VkImageSubresourceRange* pRanges) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5231 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5232 | imageObject := GetImage(image) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5233 | assert(commandBufferObject.device == imageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5234 | |
| 5235 | ranges := pRanges[0:rangeCount] |
| 5236 | for i in (0 .. rangeCount) { |
| 5237 | range := ranges[i] |
| 5238 | } |
| 5239 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5240 | bindCommandBuffer(commandBuffer, image, imageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5241 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5242 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5243 | } |
| 5244 | |
| 5245 | @threadSafety("app") |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 5246 | cmd void vkCmdClearAttachments( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5247 | VkCommandBuffer commandBuffer, |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 5248 | u32 attachmentCount, |
| 5249 | const VkClearAttachment* pAttachments, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5250 | u32 rectCount, |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 5251 | const VkClearRect* pRects) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5252 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5253 | |
| 5254 | rects := pRects[0:rectCount] |
| 5255 | for i in (0 .. rectCount) { |
| 5256 | rect := rects[i] |
| 5257 | } |
| 5258 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5259 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5260 | } |
| 5261 | |
| 5262 | @threadSafety("app") |
| 5263 | cmd void vkCmdResolveImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5264 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5265 | VkImage srcImage, |
| 5266 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5267 | VkImage dstImage, |
| 5268 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5269 | u32 regionCount, |
| 5270 | const VkImageResolve* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5271 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5272 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5273 | dstImageObject := GetImage(dstImage) |
| 5274 | assert(commandBufferObject.device == srcImageObject.device) |
| 5275 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5276 | |
| 5277 | regions := pRegions[0:regionCount] |
| 5278 | for i in (0 .. regionCount) { |
| 5279 | region := regions[i] |
| 5280 | } |
| 5281 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5282 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 5283 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5284 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5285 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5286 | } |
| 5287 | |
| 5288 | @threadSafety("app") |
| 5289 | cmd void vkCmdSetEvent( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5290 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5291 | VkEvent event, |
| 5292 | VkPipelineStageFlags stageMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5293 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5294 | eventObject := GetEvent(event) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5295 | assert(commandBufferObject.device == eventObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5296 | } |
| 5297 | |
| 5298 | @threadSafety("app") |
| 5299 | cmd void vkCmdResetEvent( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5300 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5301 | VkEvent event, |
| 5302 | VkPipelineStageFlags stageMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5303 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5304 | eventObject := GetEvent(event) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5305 | assert(commandBufferObject.device == eventObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5306 | } |
| 5307 | |
| 5308 | @threadSafety("app") |
| 5309 | cmd void vkCmdWaitEvents( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5310 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5311 | u32 eventCount, |
| 5312 | const VkEvent* pEvents, |
| 5313 | VkPipelineStageFlags srcStageMask, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5314 | VkPipelineStageFlags dstStageMask, |
| 5315 | u32 memoryBarrierCount, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5316 | const VkMemoryBarrier* pMemoryBarriers, |
| 5317 | u32 bufferMemoryBarrierCount, |
| 5318 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 5319 | u32 imageMemoryBarrierCount, |
| 5320 | const VkImageMemoryBarrier* pImageMemoryBarriers) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5321 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5322 | |
| 5323 | events := pEvents[0:eventCount] |
| 5324 | for i in (0 .. eventCount) { |
| 5325 | event := events[i] |
| 5326 | eventObject := GetEvent(event) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5327 | assert(commandBufferObject.device == eventObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5328 | } |
| 5329 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5330 | memoryBarriers := pMemoryBarriers[0:memoryBarrierCount] |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5331 | for i in (0 .. memoryBarrierCount) { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5332 | memoryBarrier := memoryBarriers[i] |
| 5333 | } |
| 5334 | bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount] |
| 5335 | for i in (0 .. bufferMemoryBarrierCount) { |
| 5336 | bufferMemoryBarrier := bufferMemoryBarriers[i] |
| 5337 | bufferObject := GetBuffer(bufferMemoryBarrier.buffer) |
| 5338 | assert(bufferObject.device == commandBufferObject.device) |
| 5339 | } |
| 5340 | imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount] |
| 5341 | for i in (0 .. imageMemoryBarrierCount) { |
| 5342 | imageMemoryBarrier := imageMemoryBarriers[i] |
| 5343 | imageObject := GetImage(imageMemoryBarrier.image) |
| 5344 | assert(imageObject.device == commandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5345 | } |
| 5346 | } |
| 5347 | |
| 5348 | @threadSafety("app") |
| 5349 | cmd void vkCmdPipelineBarrier( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5350 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5351 | VkPipelineStageFlags srcStageMask, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5352 | VkPipelineStageFlags dstStageMask, |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 5353 | VkDependencyFlags dependencyFlags, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5354 | u32 memoryBarrierCount, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5355 | const VkMemoryBarrier* pMemoryBarriers, |
| 5356 | u32 bufferMemoryBarrierCount, |
| 5357 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 5358 | u32 imageMemoryBarrierCount, |
| 5359 | const VkImageMemoryBarrier* pImageMemoryBarriers) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5360 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5361 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5362 | memoryBarriers := pMemoryBarriers[0:memoryBarrierCount] |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5363 | for i in (0 .. memoryBarrierCount) { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5364 | memoryBarrier := memoryBarriers[i] |
| 5365 | } |
| 5366 | bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount] |
| 5367 | for i in (0 .. bufferMemoryBarrierCount) { |
| 5368 | bufferMemoryBarrier := bufferMemoryBarriers[i] |
| 5369 | bufferObject := GetBuffer(bufferMemoryBarrier.buffer) |
| 5370 | assert(bufferObject.device == commandBufferObject.device) |
| 5371 | } |
| 5372 | imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount] |
| 5373 | for i in (0 .. imageMemoryBarrierCount) { |
| 5374 | imageMemoryBarrier := imageMemoryBarriers[i] |
| 5375 | imageObject := GetImage(imageMemoryBarrier.image) |
| 5376 | assert(imageObject.device == commandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5377 | } |
| 5378 | } |
| 5379 | |
| 5380 | @threadSafety("app") |
| 5381 | cmd void vkCmdBeginQuery( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5382 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5383 | VkQueryPool queryPool, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5384 | u32 query, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5385 | VkQueryControlFlags flags) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5386 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5387 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5388 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5389 | } |
| 5390 | |
| 5391 | @threadSafety("app") |
| 5392 | cmd void vkCmdEndQuery( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5393 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5394 | VkQueryPool queryPool, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5395 | u32 query) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5396 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5397 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5398 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5399 | } |
| 5400 | |
| 5401 | @threadSafety("app") |
| 5402 | cmd void vkCmdResetQueryPool( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5403 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5404 | VkQueryPool queryPool, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5405 | u32 firstQuery, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5406 | u32 queryCount) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5407 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5408 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5409 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5410 | } |
| 5411 | |
| 5412 | @threadSafety("app") |
| 5413 | cmd void vkCmdWriteTimestamp( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5414 | VkCommandBuffer commandBuffer, |
Jesse Hall | 6f39a6d | 2015-11-24 11:08:36 -0800 | [diff] [blame] | 5415 | VkPipelineStageFlagBits pipelineStage, |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 5416 | VkQueryPool queryPool, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5417 | u32 query) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5418 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 5419 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5420 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5421 | } |
| 5422 | |
| 5423 | @threadSafety("app") |
| 5424 | cmd void vkCmdCopyQueryPoolResults( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5425 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5426 | VkQueryPool queryPool, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5427 | u32 firstQuery, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5428 | u32 queryCount, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5429 | VkBuffer dstBuffer, |
| 5430 | VkDeviceSize dstOffset, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 5431 | VkDeviceSize stride, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5432 | VkQueryResultFlags flags) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5433 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5434 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5435 | dstBufferObject := GetBuffer(dstBuffer) |
| 5436 | assert(commandBufferObject.device == queryPoolObject.device) |
| 5437 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5438 | } |
| 5439 | |
| 5440 | cmd void vkCmdPushConstants( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5441 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5442 | VkPipelineLayout layout, |
| 5443 | VkShaderStageFlags stageFlags, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5444 | u32 offset, |
| 5445 | u32 size, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 5446 | const void* pValues) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5447 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5448 | layoutObject := GetPipelineLayout(layout) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5449 | assert(commandBufferObject.device == layoutObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5450 | } |
| 5451 | |
| 5452 | @threadSafety("app") |
| 5453 | cmd void vkCmdBeginRenderPass( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5454 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5455 | const VkRenderPassBeginInfo* pRenderPassBegin, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5456 | VkSubpassContents contents) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5457 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5458 | renderPassObject := GetRenderPass(pRenderPassBegin.renderPass) |
| 5459 | framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5460 | assert(commandBufferObject.device == renderPassObject.device) |
| 5461 | assert(commandBufferObject.device == framebufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5462 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5463 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5464 | } |
| 5465 | |
| 5466 | cmd void vkCmdNextSubpass( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5467 | VkCommandBuffer commandBuffer, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5468 | VkSubpassContents contents) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5469 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5470 | } |
| 5471 | |
| 5472 | @threadSafety("app") |
| 5473 | cmd void vkCmdEndRenderPass( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5474 | VkCommandBuffer commandBuffer) { |
| 5475 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5476 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5477 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5478 | } |
| 5479 | |
| 5480 | cmd void vkCmdExecuteCommands( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5481 | VkCommandBuffer commandBuffer, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5482 | u32 commandBufferCount, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5483 | const VkCommandBuffer* pCommandBuffers) { |
| 5484 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5485 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5486 | commandBuffers := pCommandBuffers[0:commandBufferCount] |
| 5487 | for i in (0 .. commandBufferCount) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5488 | secondaryCommandBuffer := commandBuffers[i] |
| 5489 | secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer) |
| 5490 | assert(commandBufferObject.device == secondaryCommandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5491 | } |
| 5492 | } |
| 5493 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5494 | @extension("VK_KHR_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5495 | cmd void vkDestroySurfaceKHR( |
| 5496 | VkInstance instance, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5497 | VkSurfaceKHR surface, |
| 5498 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5499 | instanceObject := GetInstance(instance) |
| 5500 | surfaceObject := GetSurface(surface) |
| 5501 | assert(surfaceObject.instance == instance) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5502 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5503 | State.Surfaces[surface] = null |
Jesse Hall | 2818f93 | 2015-11-19 21:19:17 -0800 | [diff] [blame] | 5504 | } |
| 5505 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5506 | @extension("VK_KHR_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5507 | cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5508 | VkPhysicalDevice physicalDevice, |
| 5509 | u32 queueFamilyIndex, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5510 | VkSurfaceKHR surface, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5511 | VkBool32* pSupported) { |
| 5512 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5513 | |
| 5514 | return ? |
| 5515 | } |
| 5516 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5517 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5518 | cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR( |
| 5519 | VkPhysicalDevice physicalDevice, |
| 5520 | VkSurfaceKHR surface, |
| 5521 | VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) { |
| 5522 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5523 | |
| 5524 | surfaceCapabilities := ? |
| 5525 | pSurfaceCapabilities[0] = surfaceCapabilities |
| 5526 | |
| 5527 | return ? |
| 5528 | } |
| 5529 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5530 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5531 | cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR( |
| 5532 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5533 | VkSurfaceKHR surface, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5534 | u32* pSurfaceFormatCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5535 | VkSurfaceFormatKHR* pSurfaceFormats) { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5536 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5537 | |
| 5538 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5539 | pSurfaceFormatCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5540 | surfaceFormats := pSurfaceFormats[0:count] |
| 5541 | |
| 5542 | for i in (0 .. count) { |
| 5543 | surfaceFormat := ? |
| 5544 | surfaceFormats[i] = surfaceFormat |
| 5545 | } |
| 5546 | |
| 5547 | return ? |
| 5548 | } |
| 5549 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5550 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5551 | cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR( |
| 5552 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5553 | VkSurfaceKHR surface, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5554 | u32* pPresentModeCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5555 | VkPresentModeKHR* pPresentModes) { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5556 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5557 | |
| 5558 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5559 | pPresentModeCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5560 | presentModes := pPresentModes[0:count] |
| 5561 | |
| 5562 | for i in (0 .. count) { |
| 5563 | presentMode := ? |
| 5564 | presentModes[i] = presentMode |
| 5565 | } |
| 5566 | |
| 5567 | return ? |
| 5568 | } |
| 5569 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5570 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5571 | cmd VkResult vkCreateSwapchainKHR( |
| 5572 | VkDevice device, |
| 5573 | const VkSwapchainCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5574 | const VkAllocationCallbacks* pAllocator, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5575 | VkSwapchainKHR* pSwapchain) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5576 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5577 | deviceObject := GetDevice(device) |
| 5578 | |
| 5579 | swapchain := ? |
| 5580 | pSwapchain[0] = swapchain |
| 5581 | State.Swapchains[swapchain] = new!SwapchainObject(device: device) |
| 5582 | |
| 5583 | return ? |
| 5584 | } |
| 5585 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5586 | @extension("VK_KHR_swapchain") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5587 | cmd void vkDestroySwapchainKHR( |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5588 | VkDevice device, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5589 | VkSwapchainKHR swapchain, |
| 5590 | const VkAllocationCallbacks* pAllocator) { |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5591 | deviceObject := GetDevice(device) |
| 5592 | swapchainObject := GetSwapchain(swapchain) |
| 5593 | assert(swapchainObject.device == device) |
| 5594 | |
| 5595 | State.Swapchains[swapchain] = null |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5596 | } |
| 5597 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5598 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5599 | cmd VkResult vkGetSwapchainImagesKHR( |
| 5600 | VkDevice device, |
| 5601 | VkSwapchainKHR swapchain, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5602 | u32* pSwapchainImageCount, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5603 | VkImage* pSwapchainImages) { |
| 5604 | deviceObject := GetDevice(device) |
| 5605 | |
| 5606 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5607 | pSwapchainImageCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5608 | swapchainImages := pSwapchainImages[0:count] |
| 5609 | |
| 5610 | for i in (0 .. count) { |
| 5611 | swapchainImage := ? |
| 5612 | swapchainImages[i] = swapchainImage |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5613 | State.Images[swapchainImage] = new!ImageObject(device: device) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5614 | } |
| 5615 | |
| 5616 | return ? |
| 5617 | } |
| 5618 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5619 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5620 | cmd VkResult vkAcquireNextImageKHR( |
| 5621 | VkDevice device, |
| 5622 | VkSwapchainKHR swapchain, |
| 5623 | u64 timeout, |
| 5624 | VkSemaphore semaphore, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5625 | VkFence fence, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5626 | u32* pImageIndex) { |
| 5627 | deviceObject := GetDevice(device) |
| 5628 | swapchainObject := GetSwapchain(swapchain) |
| 5629 | |
| 5630 | imageIndex := ? |
| 5631 | pImageIndex[0] = imageIndex |
| 5632 | |
| 5633 | return ? |
| 5634 | } |
| 5635 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5636 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5637 | cmd VkResult vkQueuePresentKHR( |
| 5638 | VkQueue queue, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 5639 | const VkPresentInfoKHR* pPresentInfo) { |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5640 | queueObject := GetQueue(queue) |
| 5641 | |
| 5642 | presentInfo := ? |
| 5643 | pPresentInfo[0] = presentInfo |
| 5644 | |
| 5645 | return ? |
| 5646 | } |
| 5647 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5648 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5649 | cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR( |
| 5650 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5651 | u32* pPropertyCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5652 | VkDisplayPropertiesKHR* pProperties) { |
| 5653 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5654 | return ? |
| 5655 | } |
| 5656 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5657 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5658 | cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR( |
| 5659 | VkPhysicalDevice physicalDevice, |
| 5660 | u32* pPropertyCount, |
| 5661 | VkDisplayPlanePropertiesKHR* pProperties) { |
| 5662 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5663 | return ? |
| 5664 | } |
| 5665 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5666 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5667 | cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR( |
| 5668 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5669 | u32 planeIndex, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 5670 | u32* pDisplayCount, |
| 5671 | VkDisplayKHR* pDisplays) { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5672 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5673 | return ? |
| 5674 | } |
| 5675 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5676 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5677 | cmd VkResult vkGetDisplayModePropertiesKHR( |
| 5678 | VkPhysicalDevice physicalDevice, |
| 5679 | VkDisplayKHR display, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5680 | u32* pPropertyCount, |
| 5681 | VkDisplayModePropertiesKHR* pProperties) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5682 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5683 | return ? |
| 5684 | } |
| 5685 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5686 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5687 | cmd VkResult vkCreateDisplayModeKHR( |
| 5688 | VkPhysicalDevice physicalDevice, |
| 5689 | VkDisplayKHR display, |
| 5690 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5691 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5692 | VkDisplayModeKHR* pMode) { |
| 5693 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5694 | return ? |
| 5695 | } |
| 5696 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5697 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5698 | cmd VkResult vkGetDisplayPlaneCapabilitiesKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5699 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 5700 | VkDisplayModeKHR mode, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5701 | u32 planeIndex, |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5702 | VkDisplayPlaneCapabilitiesKHR* pCapabilities) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5703 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5704 | return ? |
| 5705 | } |
| 5706 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5707 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5708 | cmd VkResult vkCreateDisplayPlaneSurfaceKHR( |
| 5709 | VkInstance instance, |
| 5710 | const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5711 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5712 | VkSurfaceKHR* pSurface) { |
| 5713 | return ? |
| 5714 | } |
| 5715 | |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 5716 | @extension("VK_KHR_display_swapchain") |
| 5717 | cmd VkResult vkCreateSharedSwapchainsKHR( |
| 5718 | VkDevice device, |
| 5719 | u32 swapchainCount, |
| 5720 | const VkSwapchainCreateInfoKHR* pCreateInfos, |
| 5721 | const VkAllocationCallbacks* pAllocator, |
| 5722 | VkSwapchainKHR* pSwapchains) { |
| 5723 | return ? |
| 5724 | } |
| 5725 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5726 | @extension("VK_KHR_xlib_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5727 | cmd VkResult vkCreateXlibSurfaceKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5728 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5729 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5730 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5731 | VkSurfaceKHR* pSurface) { |
| 5732 | instanceObject := GetInstance(instance) |
| 5733 | return ? |
| 5734 | } |
| 5735 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5736 | @extension("VK_KHR_xlib_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5737 | cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR( |
| 5738 | VkPhysicalDevice physicalDevice, |
| 5739 | u32 queueFamilyIndex, |
| 5740 | platform.Display* dpy, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5741 | platform.VisualID visualID) { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5742 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5743 | return ? |
| 5744 | } |
| 5745 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5746 | @extension("VK_KHR_xcb_surface") |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5747 | cmd VkResult vkCreateXcbSurfaceKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5748 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5749 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5750 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5751 | VkSurfaceKHR* pSurface) { |
| 5752 | instanceObject := GetInstance(instance) |
| 5753 | return ? |
| 5754 | } |
| 5755 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 5756 | @extension("VK_KHR_xcb_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5757 | cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR( |
| 5758 | VkPhysicalDevice physicalDevice, |
| 5759 | u32 queueFamilyIndex, |
| 5760 | platform.xcb_connection_t* connection, |
| 5761 | platform.xcb_visualid_t visual_id) { |
| 5762 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5763 | return ? |
| 5764 | } |
| 5765 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5766 | @extension("VK_KHR_wayland_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5767 | cmd VkResult vkCreateWaylandSurfaceKHR( |
| 5768 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5769 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5770 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5771 | VkSurfaceKHR* pSurface) { |
| 5772 | instanceObject := GetInstance(instance) |
| 5773 | return ? |
| 5774 | } |
| 5775 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5776 | @extension("VK_KHR_wayland_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5777 | cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR( |
| 5778 | VkPhysicalDevice physicalDevice, |
| 5779 | u32 queueFamilyIndex, |
| 5780 | platform.wl_display* display) { |
| 5781 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5782 | return ? |
| 5783 | } |
| 5784 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5785 | @extension("VK_KHR_mir_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5786 | cmd VkResult vkCreateMirSurfaceKHR( |
| 5787 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5788 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5789 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5790 | VkSurfaceKHR* pSurface) { |
| 5791 | instanceObject := GetInstance(instance) |
| 5792 | return ? |
| 5793 | } |
| 5794 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5795 | @extension("VK_KHR_mir_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5796 | cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR( |
| 5797 | VkPhysicalDevice physicalDevice, |
| 5798 | u32 queueFamilyIndex, |
| 5799 | platform.MirConnection* connection) { |
| 5800 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5801 | return ? |
| 5802 | } |
| 5803 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5804 | @extension("VK_KHR_android_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5805 | cmd VkResult vkCreateAndroidSurfaceKHR( |
| 5806 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5807 | const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5808 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5809 | VkSurfaceKHR* pSurface) { |
| 5810 | instanceObject := GetInstance(instance) |
| 5811 | return ? |
| 5812 | } |
| 5813 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5814 | @extension("VK_KHR_win32_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5815 | cmd VkResult vkCreateWin32SurfaceKHR( |
| 5816 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5817 | const VkWin32SurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5818 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5819 | VkSurfaceKHR* pSurface) { |
| 5820 | instanceObject := GetInstance(instance) |
| 5821 | return ? |
| 5822 | } |
| 5823 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5824 | @extension("VK_KHR_win32_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5825 | cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR( |
| 5826 | VkPhysicalDevice physicalDevice, |
| 5827 | u32 queueFamilyIndex) { |
Jesse Hall | e2948d8 | 2016-02-25 04:19:32 -0800 | [diff] [blame] | 5828 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5829 | return ? |
| 5830 | } |
| 5831 | |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 5832 | @extension("VK_ANDROID_native_buffer") |
| 5833 | cmd VkResult vkGetSwapchainGrallocUsageANDROID( |
| 5834 | VkDevice device, |
| 5835 | VkFormat format, |
| 5836 | VkImageUsageFlags imageUsage, |
| 5837 | int* grallocUsage) { |
| 5838 | return ? |
| 5839 | } |
| 5840 | |
| 5841 | @extension("VK_ANDROID_native_buffer") |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 5842 | cmd VkResult vkGetSwapchainGrallocUsage2ANDROID( |
| 5843 | VkDevice device, |
| 5844 | VkFormat format, |
| 5845 | VkImageUsageFlags imageUsage, |
| 5846 | VkSwapchainImageUsageFlagsANDROID swapchainImageUsage, |
| 5847 | int* grallocUsage) { |
| 5848 | return ? |
| 5849 | } |
| 5850 | |
| 5851 | @extension("VK_ANDROID_native_buffer") |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 5852 | cmd VkResult vkAcquireImageANDROID( |
| 5853 | VkDevice device, |
| 5854 | VkImage image, |
| 5855 | int nativeFenceFd, |
| 5856 | VkSemaphore semaphore, |
| 5857 | VkFence fence) { |
| 5858 | return ? |
| 5859 | } |
| 5860 | |
| 5861 | @extension("VK_ANDROID_native_buffer") |
| 5862 | cmd VkResult vkQueueSignalReleaseImageANDROID( |
| 5863 | VkQueue queue, |
| 5864 | u32 waitSemaphoreCount, |
| 5865 | const VkSemaphore* pWaitSemaphores, |
| 5866 | VkImage image, |
| 5867 | int* pNativeFenceFd) { |
| 5868 | return ? |
| 5869 | } |
| 5870 | |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 5871 | @extension("VK_GOOGLE_display_timing") |
| 5872 | cmd VkResult vkGetRefreshCycleDurationGOOGLE( |
| 5873 | VkDevice device, |
| 5874 | VkSwapchainKHR swapchain, |
| 5875 | VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) { |
| 5876 | deviceObject := GetDevice(device) |
| 5877 | swapchainObject := GetSwapchain(swapchain) |
| 5878 | |
| 5879 | displayTimingProperties := ? |
| 5880 | pDisplayTimingProperties[0] = displayTimingProperties |
| 5881 | |
| 5882 | return ? |
| 5883 | } |
| 5884 | |
| 5885 | @extension("VK_GOOGLE_display_timing") |
| 5886 | cmd VkResult vkGetPastPresentationTimingGOOGLE( |
| 5887 | VkDevice device, |
| 5888 | VkSwapchainKHR swapchain, |
| 5889 | u32* pPresentationTimingCount, |
| 5890 | VkPastPresentationTimingGOOGLE* pPresentationTimings) { |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 5891 | return ? |
| 5892 | } |
| 5893 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 5894 | @extension("VK_EXT_debug_report") |
| 5895 | @external type void* PFN_vkDebugReportCallbackEXT |
| 5896 | @extension("VK_EXT_debug_report") |
| 5897 | @pfn cmd VkBool32 vkDebugReportCallbackEXT( |
| 5898 | VkDebugReportFlagsEXT flags, |
| 5899 | VkDebugReportObjectTypeEXT objectType, |
| 5900 | u64 object, |
| 5901 | platform.size_t location, |
| 5902 | s32 messageCode, |
| 5903 | const char* pLayerPrefix, |
| 5904 | const char* pMessage, |
| 5905 | void* pUserData) { |
| 5906 | return ? |
| 5907 | } |
| 5908 | |
| 5909 | @extension("VK_EXT_debug_report") |
| 5910 | cmd VkResult vkCreateDebugReportCallbackEXT( |
| 5911 | VkInstance instance, |
| 5912 | const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, |
| 5913 | const VkAllocationCallbacks* pAllocator, |
| 5914 | VkDebugReportCallbackEXT* pCallback) { |
| 5915 | return ? |
| 5916 | } |
| 5917 | |
| 5918 | @extension("VK_EXT_debug_report") |
| 5919 | cmd void vkDestroyDebugReportCallbackEXT( |
| 5920 | VkInstance instance, |
| 5921 | VkDebugReportCallbackEXT callback, |
| 5922 | const VkAllocationCallbacks* pAllocator) { |
| 5923 | } |
| 5924 | |
| 5925 | @extension("VK_EXT_debug_report") |
| 5926 | cmd void vkDebugReportMessageEXT( |
| 5927 | VkInstance instance, |
| 5928 | VkDebugReportFlagsEXT flags, |
| 5929 | VkDebugReportObjectTypeEXT objectType, |
| 5930 | u64 object, |
| 5931 | platform.size_t location, |
| 5932 | s32 messageCode, |
| 5933 | const char* pLayerPrefix, |
| 5934 | const char* pMessage) { |
| 5935 | } |
| 5936 | |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 5937 | @extension("VK_EXT_debug_marker") |
| 5938 | cmd VkResult vkDebugMarkerSetObjectTagEXT( |
| 5939 | VkDevice device, |
| 5940 | VkDebugMarkerObjectTagInfoEXT* pTagInfo) { |
| 5941 | return ? |
| 5942 | } |
| 5943 | |
| 5944 | @extension("VK_EXT_debug_marker") |
| 5945 | cmd VkResult vkDebugMarkerSetObjectNameEXT( |
| 5946 | VkDevice device, |
| 5947 | VkDebugMarkerObjectNameInfoEXT* pNameInfo) { |
| 5948 | return ? |
| 5949 | } |
| 5950 | |
| 5951 | @extension("VK_EXT_debug_marker") |
| 5952 | cmd void vkCmdDebugMarkerBeginEXT( |
| 5953 | VkCommandBuffer commandBuffer, |
| 5954 | VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { |
| 5955 | } |
| 5956 | |
| 5957 | @extension("VK_EXT_debug_marker") |
| 5958 | cmd void vkCmdDebugMarkerEndEXT( |
| 5959 | VkCommandBuffer commandBuffer) { |
| 5960 | } |
| 5961 | |
| 5962 | @extension("VK_EXT_debug_marker") |
| 5963 | cmd void vkCmdDebugMarkerInsertEXT( |
| 5964 | VkCommandBuffer commandBuffer, |
| 5965 | VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { |
| 5966 | } |
| 5967 | |
Chris Forbes | 1194ede | 2016-12-30 16:29:25 +1300 | [diff] [blame] | 5968 | @extension("VK_KHR_get_physical_device_properties2") |
| 5969 | cmd void vkGetPhysicalDeviceFeatures2KHR( |
| 5970 | VkPhysicalDevice physicalDevice, |
| 5971 | VkPhysicalDeviceFeatures2KHR* pFeatures) { |
| 5972 | } |
| 5973 | |
| 5974 | @extension("VK_KHR_get_physical_device_properties2") |
| 5975 | cmd void vkGetPhysicalDeviceProperties2KHR( |
| 5976 | VkPhysicalDevice physicalDevice, |
| 5977 | VkPhysicalDeviceProperties2KHR* pProperties) { |
| 5978 | } |
| 5979 | |
| 5980 | @extension("VK_KHR_get_physical_device_properties2") |
| 5981 | cmd void vkGetPhysicalDeviceFormatProperties2KHR( |
| 5982 | VkPhysicalDevice physicalDevice, |
| 5983 | VkFormat format, |
| 5984 | VkFormatProperties2KHR* pFormatProperties) { |
| 5985 | } |
| 5986 | |
| 5987 | @extension("VK_KHR_get_physical_device_properties2") |
| 5988 | cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR( |
| 5989 | VkPhysicalDevice physicalDevice, |
| 5990 | const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, |
| 5991 | VkImageFormatProperties2KHR* pImageFormatProperties) { |
| 5992 | return ? |
| 5993 | } |
| 5994 | |
| 5995 | @extension("VK_KHR_get_physical_device_properties2") |
| 5996 | cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR( |
| 5997 | VkPhysicalDevice physicalDevice, |
| 5998 | u32* pQueueFamilyPropertyCount, |
| 5999 | VkQueueFamilyProperties2KHR* pQueueFamilyProperties) { |
| 6000 | } |
| 6001 | |
| 6002 | @extension("VK_KHR_get_physical_device_properties2") |
| 6003 | cmd void vkGetPhysicalDeviceMemoryProperties2KHR( |
| 6004 | VkPhysicalDevice physicalDevice, |
| 6005 | VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) { |
| 6006 | } |
| 6007 | |
| 6008 | @extension("VK_KHR_get_physical_device_properties2") |
| 6009 | cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 6010 | VkPhysicalDevice physicalDevice, |
| 6011 | const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, |
| 6012 | u32* pPropertyCount, |
| 6013 | VkSparseImageFormatProperties2KHR* pProperties) { |
| 6014 | } |
| 6015 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 6016 | @extension("VK_AMD_draw_indirect_count") |
| 6017 | cmd void vkCmdDrawIndirectCountAMD( |
| 6018 | VkCommandBuffer commandBuffer, |
| 6019 | VkBuffer buffer, |
| 6020 | VkDeviceSize offset, |
| 6021 | VkBuffer countBuffer, |
| 6022 | VkDeviceSize countBufferOffset, |
| 6023 | u32 maxDrawCount, |
| 6024 | u32 stride) { |
| 6025 | } |
| 6026 | |
| 6027 | @extension("VK_AMD_draw_indirect_count") |
| 6028 | cmd void vkCmdDrawIndexedIndirectCountAMD( |
| 6029 | VkCommandBuffer commandBuffer, |
| 6030 | VkBuffer buffer, |
| 6031 | VkDeviceSize offset, |
| 6032 | VkBuffer countBuffer, |
| 6033 | VkDeviceSize countBufferOffset, |
| 6034 | u32 maxDrawCount, |
| 6035 | u32 stride) { |
| 6036 | } |
| 6037 | |
| 6038 | @extension("VK_NV_external_memory_capabilities") |
| 6039 | cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 6040 | VkPhysicalDevice physicalDevice, |
| 6041 | VkFormat format, |
| 6042 | VkImageType type, |
| 6043 | VkImageTiling tiling, |
| 6044 | VkImageUsageFlags usage, |
| 6045 | VkImageCreateFlags flags, |
| 6046 | VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 6047 | VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) { |
| 6048 | return ? |
| 6049 | } |
| 6050 | |
| 6051 | @extension("VK_NV_external_memory_win32") |
| 6052 | cmd VkResult vkGetMemoryWin32HandleNV( |
| 6053 | VkDevice device, |
| 6054 | VkDeviceMemory memory, |
| 6055 | VkExternalMemoryHandleTypeFlagsNV handleType, |
| 6056 | platform.HANDLE* pHandle) { |
| 6057 | return ? |
| 6058 | } |
| 6059 | |
| 6060 | @extension("VK_NV_external_memory_win32") |
| 6061 | cmd void vkCmdProcessCommandsNVX( |
| 6062 | VkCommandBuffer commandBuffer, |
| 6063 | const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) { |
| 6064 | } |
| 6065 | |
| 6066 | @extension("VK_NV_external_memory_win32") |
| 6067 | cmd void vkCmdReserveSpaceForCommandsNVX( |
| 6068 | VkCommandBuffer commandBuffer, |
| 6069 | const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) { |
| 6070 | } |
| 6071 | |
| 6072 | @extension("VK_NV_external_memory_win32") |
| 6073 | cmd VkResult vkCreateIndirectCommandsLayoutNVX( |
| 6074 | VkDevice device, |
| 6075 | const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, |
| 6076 | const VkAllocationCallbacks* pAllocator, |
| 6077 | VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) { |
| 6078 | return ? |
| 6079 | } |
| 6080 | |
| 6081 | @extension("VK_NV_external_memory_win32") |
| 6082 | cmd void vkDestroyIndirectCommandsLayoutNVX( |
| 6083 | VkDevice device, |
| 6084 | VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 6085 | const VkAllocationCallbacks* pAllocator) { |
| 6086 | } |
| 6087 | |
| 6088 | @extension("VK_NV_external_memory_win32") |
| 6089 | cmd VkResult vkCreateObjectTableNVX( |
| 6090 | VkDevice device, |
| 6091 | const VkObjectTableCreateInfoNVX* pCreateInfo, |
| 6092 | const VkAllocationCallbacks* pAllocator, |
| 6093 | VkObjectTableNVX* pObjectTable) { |
| 6094 | return ? |
| 6095 | } |
| 6096 | |
| 6097 | @extension("VK_NV_external_memory_win32") |
| 6098 | cmd void vkDestroyObjectTableNVX( |
| 6099 | VkDevice device, |
| 6100 | VkObjectTableNVX objectTable, |
| 6101 | const VkAllocationCallbacks* pAllocator) { |
| 6102 | } |
| 6103 | |
| 6104 | @extension("VK_NV_external_memory_win32") |
| 6105 | cmd VkResult vkRegisterObjectsNVX( |
| 6106 | VkDevice device, |
| 6107 | VkObjectTableNVX objectTable, |
| 6108 | u32 objectCount, |
| 6109 | const VkObjectTableEntryNVX* const* ppObjectTableEntries, |
| 6110 | const u32* pObjectIndices) { |
| 6111 | return ? |
| 6112 | } |
| 6113 | |
| 6114 | @extension("VK_NV_external_memory_win32") |
| 6115 | cmd VkResult vkUnregisterObjectsNVX( |
| 6116 | VkDevice device, |
| 6117 | VkObjectTableNVX objectTable, |
| 6118 | u32 objectCount, |
| 6119 | const VkObjectEntryTypeNVX* pObjectEntryTypes, |
| 6120 | const u32* pObjectIndices) { |
| 6121 | return ? |
| 6122 | } |
| 6123 | |
| 6124 | @extension("VK_NV_external_memory_win32") |
| 6125 | cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( |
| 6126 | VkPhysicalDevice physicalDevice, |
| 6127 | VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, |
| 6128 | VkDeviceGeneratedCommandsLimitsNVX* pLimits) { |
| 6129 | } |
| 6130 | |
Chris Forbes | 1d5f68c | 2017-01-31 10:17:01 +1300 | [diff] [blame] | 6131 | @extension("VK_KHR_shared_presentable_image") |
Chris Forbes | 2e12cb8 | 2017-01-18 11:45:17 +1300 | [diff] [blame] | 6132 | cmd VkResult vkGetSwapchainStatusKHR( |
| 6133 | VkDevice device, |
| 6134 | VkSwapchainKHR swapchain) { |
| 6135 | return ? |
| 6136 | } |
| 6137 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6138 | |
| 6139 | //////////////// |
| 6140 | // Validation // |
| 6141 | //////////////// |
| 6142 | |
| 6143 | extern void validate(string layerName, bool condition, string message) |
| 6144 | |
| 6145 | |
| 6146 | ///////////////////////////// |
| 6147 | // Internal State Tracking // |
| 6148 | ///////////////////////////// |
| 6149 | |
| 6150 | StateObject State |
| 6151 | |
| 6152 | @internal class StateObject { |
| 6153 | // Dispatchable objects. |
| 6154 | map!(VkInstance, ref!InstanceObject) Instances |
| 6155 | map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices |
| 6156 | map!(VkDevice, ref!DeviceObject) Devices |
| 6157 | map!(VkQueue, ref!QueueObject) Queues |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6158 | map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6159 | |
| 6160 | // Non-dispatchable objects. |
| 6161 | map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories |
| 6162 | map!(VkBuffer, ref!BufferObject) Buffers |
| 6163 | map!(VkBufferView, ref!BufferViewObject) BufferViews |
| 6164 | map!(VkImage, ref!ImageObject) Images |
| 6165 | map!(VkImageView, ref!ImageViewObject) ImageViews |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6166 | map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6167 | map!(VkPipeline, ref!PipelineObject) Pipelines |
| 6168 | map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts |
| 6169 | map!(VkSampler, ref!SamplerObject) Samplers |
| 6170 | map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets |
| 6171 | map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts |
| 6172 | map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6173 | map!(VkFence, ref!FenceObject) Fences |
| 6174 | map!(VkSemaphore, ref!SemaphoreObject) Semaphores |
| 6175 | map!(VkEvent, ref!EventObject) Events |
| 6176 | map!(VkQueryPool, ref!QueryPoolObject) QueryPools |
| 6177 | map!(VkFramebuffer, ref!FramebufferObject) Framebuffers |
| 6178 | map!(VkRenderPass, ref!RenderPassObject) RenderPasses |
| 6179 | map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6180 | map!(VkCommandPool, ref!CommandPoolObject) CommandPools |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 6181 | map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 6182 | map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6183 | } |
| 6184 | |
| 6185 | @internal class InstanceObject { |
| 6186 | } |
| 6187 | |
| 6188 | @internal class PhysicalDeviceObject { |
| 6189 | VkInstance instance |
| 6190 | } |
| 6191 | |
| 6192 | @internal class DeviceObject { |
| 6193 | VkPhysicalDevice physicalDevice |
| 6194 | } |
| 6195 | |
| 6196 | @internal class QueueObject { |
| 6197 | VkDevice device |
| 6198 | VkQueueFlags flags |
| 6199 | } |
| 6200 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6201 | @internal class CommandBufferObject { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6202 | VkDevice device |
| 6203 | map!(u64, VkDeviceMemory) boundObjects |
| 6204 | VkQueueFlags queueFlags |
| 6205 | } |
| 6206 | |
| 6207 | @internal class DeviceMemoryObject { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6208 | VkDevice device |
| 6209 | VkDeviceSize allocationSize |
| 6210 | map!(u64, VkDeviceSize) boundObjects |
| 6211 | map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6212 | } |
| 6213 | |
| 6214 | @internal class BufferObject { |
| 6215 | VkDevice device |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6216 | VkDeviceMemory memory |
| 6217 | VkDeviceSize memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6218 | } |
| 6219 | |
| 6220 | @internal class BufferViewObject { |
| 6221 | VkDevice device |
| 6222 | VkBuffer buffer |
| 6223 | } |
| 6224 | |
| 6225 | @internal class ImageObject { |
| 6226 | VkDevice device |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6227 | VkDeviceMemory memory |
| 6228 | VkDeviceSize memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6229 | } |
| 6230 | |
| 6231 | @internal class ImageViewObject { |
| 6232 | VkDevice device |
| 6233 | VkImage image |
| 6234 | } |
| 6235 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6236 | @internal class ShaderObject { |
| 6237 | VkDevice device |
| 6238 | } |
| 6239 | |
| 6240 | @internal class ShaderModuleObject { |
| 6241 | VkDevice device |
| 6242 | } |
| 6243 | |
| 6244 | @internal class PipelineObject { |
| 6245 | VkDevice device |
| 6246 | } |
| 6247 | |
| 6248 | @internal class PipelineLayoutObject { |
| 6249 | VkDevice device |
| 6250 | } |
| 6251 | |
| 6252 | @internal class SamplerObject { |
| 6253 | VkDevice device |
| 6254 | } |
| 6255 | |
| 6256 | @internal class DescriptorSetObject { |
| 6257 | VkDevice device |
| 6258 | } |
| 6259 | |
| 6260 | @internal class DescriptorSetLayoutObject { |
| 6261 | VkDevice device |
| 6262 | } |
| 6263 | |
| 6264 | @internal class DescriptorPoolObject { |
| 6265 | VkDevice device |
| 6266 | } |
| 6267 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6268 | @internal class FenceObject { |
| 6269 | VkDevice device |
| 6270 | bool signaled |
| 6271 | } |
| 6272 | |
| 6273 | @internal class SemaphoreObject { |
| 6274 | VkDevice device |
| 6275 | } |
| 6276 | |
| 6277 | @internal class EventObject { |
| 6278 | VkDevice device |
| 6279 | } |
| 6280 | |
| 6281 | @internal class QueryPoolObject { |
| 6282 | VkDevice device |
| 6283 | } |
| 6284 | |
| 6285 | @internal class FramebufferObject { |
| 6286 | VkDevice device |
| 6287 | } |
| 6288 | |
| 6289 | @internal class RenderPassObject { |
| 6290 | VkDevice device |
| 6291 | } |
| 6292 | |
| 6293 | @internal class PipelineCacheObject { |
| 6294 | VkDevice device |
| 6295 | } |
| 6296 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6297 | @internal class CommandPoolObject { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6298 | VkDevice device |
| 6299 | } |
| 6300 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 6301 | @internal class SurfaceObject { |
| 6302 | VkInstance instance |
| 6303 | } |
| 6304 | |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 6305 | @internal class SwapchainObject { |
| 6306 | VkDevice device |
| 6307 | } |
| 6308 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6309 | macro ref!InstanceObject GetInstance(VkInstance instance) { |
| 6310 | assert(instance in State.Instances) |
| 6311 | return State.Instances[instance] |
| 6312 | } |
| 6313 | |
| 6314 | macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) { |
| 6315 | assert(physicalDevice in State.PhysicalDevices) |
| 6316 | return State.PhysicalDevices[physicalDevice] |
| 6317 | } |
| 6318 | |
| 6319 | macro ref!DeviceObject GetDevice(VkDevice device) { |
| 6320 | assert(device in State.Devices) |
| 6321 | return State.Devices[device] |
| 6322 | } |
| 6323 | |
| 6324 | macro ref!QueueObject GetQueue(VkQueue queue) { |
| 6325 | assert(queue in State.Queues) |
| 6326 | return State.Queues[queue] |
| 6327 | } |
| 6328 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6329 | macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) { |
| 6330 | assert(commandBuffer in State.CommandBuffers) |
| 6331 | return State.CommandBuffers[commandBuffer] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6332 | } |
| 6333 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6334 | macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) { |
| 6335 | assert(memory in State.DeviceMemories) |
| 6336 | return State.DeviceMemories[memory] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6337 | } |
| 6338 | |
| 6339 | macro ref!BufferObject GetBuffer(VkBuffer buffer) { |
| 6340 | assert(buffer in State.Buffers) |
| 6341 | return State.Buffers[buffer] |
| 6342 | } |
| 6343 | |
| 6344 | macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) { |
| 6345 | assert(bufferView in State.BufferViews) |
| 6346 | return State.BufferViews[bufferView] |
| 6347 | } |
| 6348 | |
| 6349 | macro ref!ImageObject GetImage(VkImage image) { |
| 6350 | assert(image in State.Images) |
| 6351 | return State.Images[image] |
| 6352 | } |
| 6353 | |
| 6354 | macro ref!ImageViewObject GetImageView(VkImageView imageView) { |
| 6355 | assert(imageView in State.ImageViews) |
| 6356 | return State.ImageViews[imageView] |
| 6357 | } |
| 6358 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6359 | macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) { |
| 6360 | assert(shaderModule in State.ShaderModules) |
| 6361 | return State.ShaderModules[shaderModule] |
| 6362 | } |
| 6363 | |
| 6364 | macro ref!PipelineObject GetPipeline(VkPipeline pipeline) { |
| 6365 | assert(pipeline in State.Pipelines) |
| 6366 | return State.Pipelines[pipeline] |
| 6367 | } |
| 6368 | |
| 6369 | macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) { |
| 6370 | assert(pipelineLayout in State.PipelineLayouts) |
| 6371 | return State.PipelineLayouts[pipelineLayout] |
| 6372 | } |
| 6373 | |
| 6374 | macro ref!SamplerObject GetSampler(VkSampler sampler) { |
| 6375 | assert(sampler in State.Samplers) |
| 6376 | return State.Samplers[sampler] |
| 6377 | } |
| 6378 | |
| 6379 | macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) { |
| 6380 | assert(descriptorSet in State.DescriptorSets) |
| 6381 | return State.DescriptorSets[descriptorSet] |
| 6382 | } |
| 6383 | |
| 6384 | macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) { |
| 6385 | assert(descriptorSetLayout in State.DescriptorSetLayouts) |
| 6386 | return State.DescriptorSetLayouts[descriptorSetLayout] |
| 6387 | } |
| 6388 | |
| 6389 | macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) { |
| 6390 | assert(descriptorPool in State.DescriptorPools) |
| 6391 | return State.DescriptorPools[descriptorPool] |
| 6392 | } |
| 6393 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6394 | macro ref!FenceObject GetFence(VkFence fence) { |
| 6395 | assert(fence in State.Fences) |
| 6396 | return State.Fences[fence] |
| 6397 | } |
| 6398 | |
| 6399 | macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) { |
| 6400 | assert(semaphore in State.Semaphores) |
| 6401 | return State.Semaphores[semaphore] |
| 6402 | } |
| 6403 | |
| 6404 | macro ref!EventObject GetEvent(VkEvent event) { |
| 6405 | assert(event in State.Events) |
| 6406 | return State.Events[event] |
| 6407 | } |
| 6408 | |
| 6409 | macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) { |
| 6410 | assert(queryPool in State.QueryPools) |
| 6411 | return State.QueryPools[queryPool] |
| 6412 | } |
| 6413 | |
| 6414 | macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) { |
| 6415 | assert(framebuffer in State.Framebuffers) |
| 6416 | return State.Framebuffers[framebuffer] |
| 6417 | } |
| 6418 | |
| 6419 | macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) { |
| 6420 | assert(renderPass in State.RenderPasses) |
| 6421 | return State.RenderPasses[renderPass] |
| 6422 | } |
| 6423 | |
| 6424 | macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) { |
| 6425 | assert(pipelineCache in State.PipelineCaches) |
| 6426 | return State.PipelineCaches[pipelineCache] |
| 6427 | } |
| 6428 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6429 | macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) { |
| 6430 | assert(commandPool in State.CommandPools) |
| 6431 | return State.CommandPools[commandPool] |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 6432 | } |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 6433 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 6434 | macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) { |
| 6435 | assert(surface in State.Surfaces) |
| 6436 | return State.Surfaces[surface] |
| 6437 | } |
| 6438 | |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 6439 | macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) { |
| 6440 | assert(swapchain in State.Swapchains) |
| 6441 | return State.Swapchains[swapchain] |
| 6442 | } |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 6443 | |
| 6444 | macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) { |
| 6445 | return as!VkQueueFlags(as!u32(flags) | as!u32(bit)) |
| 6446 | } |