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, |
Chris Forbes | af3a111 | 2017-01-31 15:37:03 +1300 | [diff] [blame] | 226 | |
| 227 | //@extension("VK_KHR_shared_presentable_image") |
| 228 | VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | enum VkAttachmentLoadOp { |
| 232 | VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000, |
| 233 | VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001, |
| 234 | VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002, |
| 235 | } |
| 236 | |
| 237 | enum VkAttachmentStoreOp { |
| 238 | VK_ATTACHMENT_STORE_OP_STORE = 0x00000000, |
| 239 | VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001, |
| 240 | } |
| 241 | |
| 242 | enum VkImageType { |
| 243 | VK_IMAGE_TYPE_1D = 0x00000000, |
| 244 | VK_IMAGE_TYPE_2D = 0x00000001, |
| 245 | VK_IMAGE_TYPE_3D = 0x00000002, |
| 246 | } |
| 247 | |
| 248 | enum VkImageTiling { |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 249 | VK_IMAGE_TILING_OPTIMAL = 0x00000000, |
| 250 | VK_IMAGE_TILING_LINEAR = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 251 | } |
| 252 | |
| 253 | enum VkImageViewType { |
| 254 | VK_IMAGE_VIEW_TYPE_1D = 0x00000000, |
| 255 | VK_IMAGE_VIEW_TYPE_2D = 0x00000001, |
| 256 | VK_IMAGE_VIEW_TYPE_3D = 0x00000002, |
| 257 | VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003, |
| 258 | VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004, |
| 259 | VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005, |
| 260 | VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006, |
| 261 | } |
| 262 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 263 | enum VkCommandBufferLevel { |
| 264 | VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000, |
| 265 | VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 266 | } |
| 267 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 268 | enum VkComponentSwizzle { |
| 269 | VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000, |
| 270 | VK_COMPONENT_SWIZZLE_ZERO = 0x00000001, |
| 271 | VK_COMPONENT_SWIZZLE_ONE = 0x00000002, |
| 272 | VK_COMPONENT_SWIZZLE_R = 0x00000003, |
| 273 | VK_COMPONENT_SWIZZLE_G = 0x00000004, |
| 274 | VK_COMPONENT_SWIZZLE_B = 0x00000005, |
| 275 | VK_COMPONENT_SWIZZLE_A = 0x00000006, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 276 | } |
| 277 | |
| 278 | enum VkDescriptorType { |
| 279 | VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000, |
| 280 | VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001, |
| 281 | VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002, |
| 282 | VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003, |
| 283 | VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004, |
| 284 | VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005, |
| 285 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006, |
| 286 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007, |
| 287 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008, |
| 288 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009, |
| 289 | VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a, |
| 290 | } |
| 291 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 292 | enum VkQueryType { |
| 293 | VK_QUERY_TYPE_OCCLUSION = 0x00000000, |
| 294 | VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 295 | VK_QUERY_TYPE_TIMESTAMP = 0x00000002, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 296 | } |
| 297 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 298 | enum VkBorderColor { |
| 299 | VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000, |
| 300 | VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001, |
| 301 | VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002, |
| 302 | VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003, |
| 303 | VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004, |
| 304 | VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005, |
| 305 | } |
| 306 | |
| 307 | enum VkPipelineBindPoint { |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 308 | VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000, |
| 309 | VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | enum VkPrimitiveTopology { |
| 313 | VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000, |
| 314 | VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001, |
| 315 | VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002, |
| 316 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003, |
| 317 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004, |
| 318 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 319 | VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006, |
| 320 | VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007, |
| 321 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008, |
| 322 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009, |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 323 | VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 324 | } |
| 325 | |
| 326 | enum VkSharingMode { |
| 327 | VK_SHARING_MODE_EXCLUSIVE = 0x00000000, |
| 328 | VK_SHARING_MODE_CONCURRENT = 0x00000001, |
| 329 | } |
| 330 | |
| 331 | enum VkIndexType { |
| 332 | VK_INDEX_TYPE_UINT16 = 0x00000000, |
| 333 | VK_INDEX_TYPE_UINT32 = 0x00000001, |
| 334 | } |
| 335 | |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 336 | enum VkFilter { |
| 337 | VK_FILTER_NEAREST = 0x00000000, |
| 338 | VK_FILTER_LINEAR = 0x00000001, |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 339 | |
| 340 | //@extension("VK_IMG_filter_cubic") |
| 341 | VK_FILTER_CUBIC_IMG = 1000015000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 342 | } |
| 343 | |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 344 | enum VkSamplerMipmapMode { |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 345 | VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level |
| 346 | VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 347 | } |
| 348 | |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 349 | enum VkSamplerAddressMode { |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 350 | VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000, |
| 351 | VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001, |
| 352 | VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002, |
| 353 | VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003, |
| 354 | VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 355 | } |
| 356 | |
| 357 | enum VkCompareOp { |
| 358 | VK_COMPARE_OP_NEVER = 0x00000000, |
| 359 | VK_COMPARE_OP_LESS = 0x00000001, |
| 360 | VK_COMPARE_OP_EQUAL = 0x00000002, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 361 | VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 362 | VK_COMPARE_OP_GREATER = 0x00000004, |
| 363 | VK_COMPARE_OP_NOT_EQUAL = 0x00000005, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 364 | VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 365 | VK_COMPARE_OP_ALWAYS = 0x00000007, |
| 366 | } |
| 367 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 368 | enum VkPolygonMode { |
| 369 | VK_POLYGON_MODE_FILL = 0x00000000, |
| 370 | VK_POLYGON_MODE_LINE = 0x00000001, |
| 371 | VK_POLYGON_MODE_POINT = 0x00000002, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 372 | } |
| 373 | |
| 374 | enum VkFrontFace { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 375 | VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000, |
| 376 | VK_FRONT_FACE_CLOCKWISE = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 377 | } |
| 378 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 379 | enum VkBlendFactor { |
| 380 | VK_BLEND_FACTOR_ZERO = 0x00000000, |
| 381 | VK_BLEND_FACTOR_ONE = 0x00000001, |
| 382 | VK_BLEND_FACTOR_SRC_COLOR = 0x00000002, |
| 383 | VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003, |
| 384 | VK_BLEND_FACTOR_DST_COLOR = 0x00000004, |
| 385 | VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005, |
| 386 | VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006, |
| 387 | VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007, |
| 388 | VK_BLEND_FACTOR_DST_ALPHA = 0x00000008, |
| 389 | VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009, |
| 390 | VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a, |
| 391 | VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b, |
| 392 | VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c, |
| 393 | VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d, |
| 394 | VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e, |
| 395 | VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f, |
| 396 | VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010, |
| 397 | VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011, |
| 398 | VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 399 | } |
| 400 | |
| 401 | enum VkBlendOp { |
| 402 | VK_BLEND_OP_ADD = 0x00000000, |
| 403 | VK_BLEND_OP_SUBTRACT = 0x00000001, |
| 404 | VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002, |
| 405 | VK_BLEND_OP_MIN = 0x00000003, |
| 406 | VK_BLEND_OP_MAX = 0x00000004, |
| 407 | } |
| 408 | |
| 409 | enum VkStencilOp { |
| 410 | VK_STENCIL_OP_KEEP = 0x00000000, |
| 411 | VK_STENCIL_OP_ZERO = 0x00000001, |
| 412 | VK_STENCIL_OP_REPLACE = 0x00000002, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 413 | VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003, |
| 414 | VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 415 | VK_STENCIL_OP_INVERT = 0x00000005, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 416 | VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006, |
| 417 | VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 418 | } |
| 419 | |
| 420 | enum VkLogicOp { |
| 421 | VK_LOGIC_OP_CLEAR = 0x00000000, |
| 422 | VK_LOGIC_OP_AND = 0x00000001, |
| 423 | VK_LOGIC_OP_AND_REVERSE = 0x00000002, |
| 424 | VK_LOGIC_OP_COPY = 0x00000003, |
| 425 | VK_LOGIC_OP_AND_INVERTED = 0x00000004, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 426 | VK_LOGIC_OP_NO_OP = 0x00000005, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 427 | VK_LOGIC_OP_XOR = 0x00000006, |
| 428 | VK_LOGIC_OP_OR = 0x00000007, |
| 429 | VK_LOGIC_OP_NOR = 0x00000008, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 430 | VK_LOGIC_OP_EQUIVALENT = 0x00000009, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 431 | VK_LOGIC_OP_INVERT = 0x0000000a, |
| 432 | VK_LOGIC_OP_OR_REVERSE = 0x0000000b, |
| 433 | VK_LOGIC_OP_COPY_INVERTED = 0x0000000c, |
| 434 | VK_LOGIC_OP_OR_INVERTED = 0x0000000d, |
| 435 | VK_LOGIC_OP_NAND = 0x0000000e, |
| 436 | VK_LOGIC_OP_SET = 0x0000000f, |
| 437 | } |
| 438 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 439 | enum VkSystemAllocationScope { |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 440 | VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 441 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001, |
| 442 | VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002, |
| 443 | VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003, |
| 444 | VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 445 | } |
| 446 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 447 | enum VkInternalAllocationType { |
| 448 | VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 449 | } |
| 450 | |
| 451 | enum VkPhysicalDeviceType { |
| 452 | VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000, |
| 453 | VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001, |
| 454 | VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002, |
| 455 | VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003, |
| 456 | VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004, |
| 457 | } |
| 458 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 459 | enum VkVertexInputRate { |
| 460 | VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000, |
| 461 | VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 462 | } |
| 463 | |
| 464 | /// Vulkan format definitions |
| 465 | enum VkFormat { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 466 | VK_FORMAT_UNDEFINED = 0, |
| 467 | VK_FORMAT_R4G4_UNORM_PACK8 = 1, |
| 468 | VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, |
| 469 | VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, |
| 470 | VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, |
| 471 | VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, |
| 472 | VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, |
| 473 | VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, |
| 474 | VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, |
| 475 | VK_FORMAT_R8_UNORM = 9, |
| 476 | VK_FORMAT_R8_SNORM = 10, |
| 477 | VK_FORMAT_R8_USCALED = 11, |
| 478 | VK_FORMAT_R8_SSCALED = 12, |
| 479 | VK_FORMAT_R8_UINT = 13, |
| 480 | VK_FORMAT_R8_SINT = 14, |
| 481 | VK_FORMAT_R8_SRGB = 15, |
| 482 | VK_FORMAT_R8G8_UNORM = 16, |
| 483 | VK_FORMAT_R8G8_SNORM = 17, |
| 484 | VK_FORMAT_R8G8_USCALED = 18, |
| 485 | VK_FORMAT_R8G8_SSCALED = 19, |
| 486 | VK_FORMAT_R8G8_UINT = 20, |
| 487 | VK_FORMAT_R8G8_SINT = 21, |
| 488 | VK_FORMAT_R8G8_SRGB = 22, |
| 489 | VK_FORMAT_R8G8B8_UNORM = 23, |
| 490 | VK_FORMAT_R8G8B8_SNORM = 24, |
| 491 | VK_FORMAT_R8G8B8_USCALED = 25, |
| 492 | VK_FORMAT_R8G8B8_SSCALED = 26, |
| 493 | VK_FORMAT_R8G8B8_UINT = 27, |
| 494 | VK_FORMAT_R8G8B8_SINT = 28, |
| 495 | VK_FORMAT_R8G8B8_SRGB = 29, |
| 496 | VK_FORMAT_B8G8R8_UNORM = 30, |
| 497 | VK_FORMAT_B8G8R8_SNORM = 31, |
| 498 | VK_FORMAT_B8G8R8_USCALED = 32, |
| 499 | VK_FORMAT_B8G8R8_SSCALED = 33, |
| 500 | VK_FORMAT_B8G8R8_UINT = 34, |
| 501 | VK_FORMAT_B8G8R8_SINT = 35, |
| 502 | VK_FORMAT_B8G8R8_SRGB = 36, |
| 503 | VK_FORMAT_R8G8B8A8_UNORM = 37, |
| 504 | VK_FORMAT_R8G8B8A8_SNORM = 38, |
| 505 | VK_FORMAT_R8G8B8A8_USCALED = 39, |
| 506 | VK_FORMAT_R8G8B8A8_SSCALED = 40, |
| 507 | VK_FORMAT_R8G8B8A8_UINT = 41, |
| 508 | VK_FORMAT_R8G8B8A8_SINT = 42, |
| 509 | VK_FORMAT_R8G8B8A8_SRGB = 43, |
| 510 | VK_FORMAT_B8G8R8A8_UNORM = 44, |
| 511 | VK_FORMAT_B8G8R8A8_SNORM = 45, |
| 512 | VK_FORMAT_B8G8R8A8_USCALED = 46, |
| 513 | VK_FORMAT_B8G8R8A8_SSCALED = 47, |
| 514 | VK_FORMAT_B8G8R8A8_UINT = 48, |
| 515 | VK_FORMAT_B8G8R8A8_SINT = 49, |
| 516 | VK_FORMAT_B8G8R8A8_SRGB = 50, |
| 517 | VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, |
| 518 | VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, |
| 519 | VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, |
| 520 | VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, |
| 521 | VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, |
| 522 | VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, |
| 523 | VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, |
| 524 | VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, |
| 525 | VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, |
| 526 | VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, |
| 527 | VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, |
| 528 | VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, |
| 529 | VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, |
| 530 | VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, |
| 531 | VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, |
| 532 | VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, |
| 533 | VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, |
| 534 | VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, |
| 535 | VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, |
| 536 | VK_FORMAT_R16_UNORM = 70, |
| 537 | VK_FORMAT_R16_SNORM = 71, |
| 538 | VK_FORMAT_R16_USCALED = 72, |
| 539 | VK_FORMAT_R16_SSCALED = 73, |
| 540 | VK_FORMAT_R16_UINT = 74, |
| 541 | VK_FORMAT_R16_SINT = 75, |
| 542 | VK_FORMAT_R16_SFLOAT = 76, |
| 543 | VK_FORMAT_R16G16_UNORM = 77, |
| 544 | VK_FORMAT_R16G16_SNORM = 78, |
| 545 | VK_FORMAT_R16G16_USCALED = 79, |
| 546 | VK_FORMAT_R16G16_SSCALED = 80, |
| 547 | VK_FORMAT_R16G16_UINT = 81, |
| 548 | VK_FORMAT_R16G16_SINT = 82, |
| 549 | VK_FORMAT_R16G16_SFLOAT = 83, |
| 550 | VK_FORMAT_R16G16B16_UNORM = 84, |
| 551 | VK_FORMAT_R16G16B16_SNORM = 85, |
| 552 | VK_FORMAT_R16G16B16_USCALED = 86, |
| 553 | VK_FORMAT_R16G16B16_SSCALED = 87, |
| 554 | VK_FORMAT_R16G16B16_UINT = 88, |
| 555 | VK_FORMAT_R16G16B16_SINT = 89, |
| 556 | VK_FORMAT_R16G16B16_SFLOAT = 90, |
| 557 | VK_FORMAT_R16G16B16A16_UNORM = 91, |
| 558 | VK_FORMAT_R16G16B16A16_SNORM = 92, |
| 559 | VK_FORMAT_R16G16B16A16_USCALED = 93, |
| 560 | VK_FORMAT_R16G16B16A16_SSCALED = 94, |
| 561 | VK_FORMAT_R16G16B16A16_UINT = 95, |
| 562 | VK_FORMAT_R16G16B16A16_SINT = 96, |
| 563 | VK_FORMAT_R16G16B16A16_SFLOAT = 97, |
| 564 | VK_FORMAT_R32_UINT = 98, |
| 565 | VK_FORMAT_R32_SINT = 99, |
| 566 | VK_FORMAT_R32_SFLOAT = 100, |
| 567 | VK_FORMAT_R32G32_UINT = 101, |
| 568 | VK_FORMAT_R32G32_SINT = 102, |
| 569 | VK_FORMAT_R32G32_SFLOAT = 103, |
| 570 | VK_FORMAT_R32G32B32_UINT = 104, |
| 571 | VK_FORMAT_R32G32B32_SINT = 105, |
| 572 | VK_FORMAT_R32G32B32_SFLOAT = 106, |
| 573 | VK_FORMAT_R32G32B32A32_UINT = 107, |
| 574 | VK_FORMAT_R32G32B32A32_SINT = 108, |
| 575 | VK_FORMAT_R32G32B32A32_SFLOAT = 109, |
| 576 | VK_FORMAT_R64_UINT = 110, |
| 577 | VK_FORMAT_R64_SINT = 111, |
| 578 | VK_FORMAT_R64_SFLOAT = 112, |
| 579 | VK_FORMAT_R64G64_UINT = 113, |
| 580 | VK_FORMAT_R64G64_SINT = 114, |
| 581 | VK_FORMAT_R64G64_SFLOAT = 115, |
| 582 | VK_FORMAT_R64G64B64_UINT = 116, |
| 583 | VK_FORMAT_R64G64B64_SINT = 117, |
| 584 | VK_FORMAT_R64G64B64_SFLOAT = 118, |
| 585 | VK_FORMAT_R64G64B64A64_UINT = 119, |
| 586 | VK_FORMAT_R64G64B64A64_SINT = 120, |
| 587 | VK_FORMAT_R64G64B64A64_SFLOAT = 121, |
| 588 | VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, |
| 589 | VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, |
| 590 | VK_FORMAT_D16_UNORM = 124, |
| 591 | VK_FORMAT_X8_D24_UNORM_PACK32 = 125, |
| 592 | VK_FORMAT_D32_SFLOAT = 126, |
| 593 | VK_FORMAT_S8_UINT = 127, |
| 594 | VK_FORMAT_D16_UNORM_S8_UINT = 128, |
| 595 | VK_FORMAT_D24_UNORM_S8_UINT = 129, |
| 596 | VK_FORMAT_D32_SFLOAT_S8_UINT = 130, |
| 597 | VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, |
| 598 | VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, |
| 599 | VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, |
| 600 | VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, |
| 601 | VK_FORMAT_BC2_UNORM_BLOCK = 135, |
| 602 | VK_FORMAT_BC2_SRGB_BLOCK = 136, |
| 603 | VK_FORMAT_BC3_UNORM_BLOCK = 137, |
| 604 | VK_FORMAT_BC3_SRGB_BLOCK = 138, |
| 605 | VK_FORMAT_BC4_UNORM_BLOCK = 139, |
| 606 | VK_FORMAT_BC4_SNORM_BLOCK = 140, |
| 607 | VK_FORMAT_BC5_UNORM_BLOCK = 141, |
| 608 | VK_FORMAT_BC5_SNORM_BLOCK = 142, |
| 609 | VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, |
| 610 | VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, |
| 611 | VK_FORMAT_BC7_UNORM_BLOCK = 145, |
| 612 | VK_FORMAT_BC7_SRGB_BLOCK = 146, |
| 613 | VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, |
| 614 | VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, |
| 615 | VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, |
| 616 | VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, |
| 617 | VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, |
| 618 | VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, |
| 619 | VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, |
| 620 | VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, |
| 621 | VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, |
| 622 | VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, |
| 623 | VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, |
| 624 | VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, |
| 625 | VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, |
| 626 | VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, |
| 627 | VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, |
| 628 | VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, |
| 629 | VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, |
| 630 | VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, |
| 631 | VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, |
| 632 | VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, |
| 633 | VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, |
| 634 | VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, |
| 635 | VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, |
| 636 | VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, |
| 637 | VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, |
| 638 | VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, |
| 639 | VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, |
| 640 | VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, |
| 641 | VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, |
| 642 | VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, |
| 643 | VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, |
| 644 | VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, |
| 645 | VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, |
| 646 | VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, |
| 647 | VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, |
| 648 | VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, |
| 649 | VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, |
| 650 | VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 651 | |
| 652 | //@extension("VK_IMG_format_pvrtc") |
| 653 | VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, |
| 654 | |
| 655 | //@extension("VK_IMG_format_pvrtc") |
| 656 | VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, |
| 657 | |
| 658 | //@extension("VK_IMG_format_pvrtc") |
| 659 | VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, |
| 660 | |
| 661 | //@extension("VK_IMG_format_pvrtc") |
| 662 | VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, |
| 663 | |
| 664 | //@extension("VK_IMG_format_pvrtc") |
| 665 | VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, |
| 666 | |
| 667 | //@extension("VK_IMG_format_pvrtc") |
| 668 | VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, |
| 669 | |
| 670 | //@extension("VK_IMG_format_pvrtc") |
| 671 | VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, |
| 672 | |
| 673 | //@extension("VK_IMG_format_pvrtc") |
| 674 | VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 675 | } |
| 676 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 677 | /// Structure type enumerant |
| 678 | enum VkStructureType { |
| 679 | VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 680 | VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, |
| 681 | VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, |
| 682 | VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, |
| 683 | VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 684 | VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 685 | VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, |
| 686 | VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, |
| 687 | VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, |
| 688 | VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 689 | VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 690 | VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, |
| 691 | VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, |
| 692 | VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, |
| 693 | VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, |
| 694 | VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, |
| 695 | VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 696 | VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, |
| 697 | VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, |
| 698 | VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, |
| 699 | VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, |
| 700 | VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, |
| 701 | VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, |
| 702 | VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, |
| 703 | VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, |
| 704 | VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, |
| 705 | VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, |
| 706 | VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, |
| 707 | VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, |
| 708 | VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, |
| 709 | VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, |
| 710 | VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, |
| 711 | VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, |
| 712 | VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 713 | VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 714 | VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, |
| 715 | VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, |
| 716 | VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, |
| 717 | VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, |
| 718 | VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 719 | VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 720 | VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, |
| 721 | VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, |
| 722 | VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, |
| 723 | VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, |
| 724 | VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, |
| 725 | VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, |
| 726 | VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, |
| 727 | VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 728 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 729 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 730 | VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, |
| 731 | VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 732 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 733 | //@extension("VK_KHR_display") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 734 | VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000, |
| 735 | VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 736 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 737 | //@extension("VK_KHR_display_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 738 | VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 739 | |
| 740 | //@extension("VK_KHR_xlib_surface") |
| 741 | VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, |
| 742 | |
| 743 | //@extension("VK_KHR_xcb_surface") |
| 744 | VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, |
| 745 | |
| 746 | //@extension("VK_KHR_wayland_surface") |
| 747 | VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, |
| 748 | |
| 749 | //@extension("VK_KHR_mir_surface") |
| 750 | VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, |
| 751 | |
| 752 | //@extension("VK_KHR_android_surface") |
| 753 | VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, |
| 754 | |
| 755 | //@extension("VK_KHR_win32_surface") |
| 756 | VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 757 | |
Ian Elliott | 948233a | 2017-01-06 12:13:23 -0700 | [diff] [blame] | 758 | //@extension("VK_KHR_incremental_present") |
| 759 | VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, |
| 760 | |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 761 | //@extension("VK_ANDROID_native_buffer") |
| 762 | VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000, |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 763 | VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001, |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 764 | |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 765 | //@extension("VK_GOOGLE_display_timing") |
Ian Elliott | 14866bb | 2017-01-20 09:15:48 -0700 | [diff] [blame] | 766 | VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000, |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 767 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 768 | //@extension("VK_EXT_debug_report") |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 769 | VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, |
| 770 | |
| 771 | //@extension("VK_AMD_rasterization_order") |
| 772 | VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, |
| 773 | |
| 774 | //@extension("VK_EXT_debug_marker") |
| 775 | VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, |
| 776 | |
| 777 | //@extension("VK_EXT_debug_marker") |
| 778 | VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, |
| 779 | |
| 780 | //@extension("VK_EXT_debug_marker") |
| 781 | VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 782 | |
| 783 | //@extension("VK_NV_dedicated_allocation") |
| 784 | VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, |
| 785 | |
| 786 | //@extension("VK_NV_dedicated_allocation") |
| 787 | VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, |
| 788 | |
| 789 | //@extension("VK_NV_dedicated_allocation") |
| 790 | VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 791 | |
| 792 | //@extension("VK_NV_external_memory") |
| 793 | VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, |
| 794 | |
| 795 | //@extension("VK_NV_external_memory") |
| 796 | VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, |
| 797 | |
| 798 | //@extension("VK_NV_external_memory_win32") |
| 799 | VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000, |
| 800 | |
| 801 | //@extension("VK_NV_external_memory_win32") |
| 802 | VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001, |
| 803 | |
| 804 | //@extension("VK_NV_win32_keyed_mutex") |
| 805 | VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000, |
| 806 | |
Chris Forbes | 1194ede | 2016-12-30 16:29:25 +1300 | [diff] [blame] | 807 | //@extension("VK_KHR_get_physical_device_properties2") |
| 808 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000, |
| 809 | |
| 810 | //@extension("VK_KHR_get_physical_device_properties2") |
| 811 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001, |
| 812 | |
| 813 | //@extension("VK_KHR_get_physical_device_properties2") |
| 814 | VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002, |
| 815 | |
| 816 | //@extension("VK_KHR_get_physical_device_properties2") |
| 817 | VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003, |
| 818 | |
| 819 | //@extension("VK_KHR_get_physical_device_properties2") |
| 820 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004, |
| 821 | |
| 822 | //@extension("VK_KHR_get_physical_device_properties2") |
| 823 | VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005, |
| 824 | |
| 825 | //@extension("VK_KHR_get_physical_device_properties2") |
| 826 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006, |
| 827 | |
| 828 | //@extension("VK_KHR_get_physical_device_properties2") |
| 829 | VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007, |
| 830 | |
| 831 | //@extension("VK_KHR_get_physical_device_properties2") |
| 832 | VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008, |
| 833 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 834 | //@extension("VK_EXT_validation_flags") |
| 835 | VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000, |
| 836 | |
| 837 | //@extension("VK_KHR_incremental_present") |
| 838 | VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, |
| 839 | |
| 840 | //@extension("VK_NVX_device_generated_commands") |
| 841 | VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000, |
| 842 | |
| 843 | //@extension("VK_NVX_device_generated_commands") |
| 844 | VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001, |
| 845 | |
| 846 | //@extension("VK_NVX_device_generated_commands") |
| 847 | VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002, |
| 848 | |
| 849 | //@extension("VK_NVX_device_generated_commands") |
| 850 | VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003, |
| 851 | |
| 852 | //@extension("VK_NVX_device_generated_commands") |
| 853 | VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004, |
| 854 | |
| 855 | //@extension("VK_NVX_device_generated_commands") |
| 856 | VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 857 | } |
| 858 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 859 | enum VkSubpassContents { |
| 860 | VK_SUBPASS_CONTENTS_INLINE = 0x00000000, |
| 861 | VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 862 | } |
| 863 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 864 | enum VkPipelineCacheHeaderVersion { |
| 865 | VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, |
| 866 | } |
| 867 | |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 868 | @lastUnused(-11) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 869 | /// Error and return codes |
| 870 | enum VkResult { |
| 871 | // Return codes for successful operation execution (positive values) |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 872 | VK_SUCCESS = 0, |
| 873 | VK_NOT_READY = 1, |
| 874 | VK_TIMEOUT = 2, |
| 875 | VK_EVENT_SET = 3, |
| 876 | VK_EVENT_RESET = 4, |
| 877 | VK_INCOMPLETE = 5, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 878 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 879 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 880 | VK_SUBOPTIMAL_KHR = 1000001003, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 881 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 882 | // Error codes (negative values) |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 883 | VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1 |
| 884 | VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2 |
| 885 | VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3 |
| 886 | VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4 |
| 887 | VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5 |
| 888 | VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6 |
| 889 | VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7 |
| 890 | VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8 |
| 891 | VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9 |
| 892 | VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10 |
| 893 | VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11 |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 894 | VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12 |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 895 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 896 | //@extension("VK_KHR_surface") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 897 | VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000 |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 898 | |
Jesse Hall | 563380d | 2016-01-15 23:14:05 -0800 | [diff] [blame] | 899 | //@extension("VK_KHR_surface") |
| 900 | VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001 |
| 901 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 902 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 903 | VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004 |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 904 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 905 | //@extension("VK_KHR_display_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 906 | VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001 |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 907 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 908 | //@extension("VK_EXT_debug_report") |
| 909 | VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001 |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 910 | |
| 911 | //@extension("VK_NV_glsl_shader") |
| 912 | VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000 |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 913 | } |
| 914 | |
| 915 | enum VkDynamicState { |
| 916 | VK_DYNAMIC_STATE_VIEWPORT = 0x00000000, |
| 917 | VK_DYNAMIC_STATE_SCISSOR = 0x00000001, |
| 918 | VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002, |
| 919 | VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003, |
| 920 | VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004, |
| 921 | VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005, |
| 922 | VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006, |
| 923 | VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007, |
| 924 | VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 925 | } |
| 926 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 927 | @extension("VK_KHR_surface") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 928 | enum VkPresentModeKHR { |
| 929 | VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000, |
| 930 | VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001, |
| 931 | VK_PRESENT_MODE_FIFO_KHR = 0x00000002, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 932 | VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003, |
Chris Forbes | 1d5f68c | 2017-01-31 10:17:01 +1300 | [diff] [blame] | 933 | //@extension("VK_KHR_shared_presentable_image") |
| 934 | VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000, |
| 935 | //@extension("VK_KHR_shared_presentable_image") |
| 936 | VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 937 | } |
| 938 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 939 | @extension("VK_KHR_surface") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 940 | enum VkColorSpaceKHR { |
| 941 | VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000, |
Courtney Goeltzenleuchter | 7f558ed | 2017-01-23 17:15:24 -0700 | [diff] [blame] | 942 | VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104001, |
| 943 | VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104002, |
| 944 | VK_COLOR_SPACE_SCRGB_LINEAR_EXT = 1000104003, |
| 945 | VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT = 1000104004, |
| 946 | VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104005, |
| 947 | VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104006, |
| 948 | VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104007, |
| 949 | VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104008, |
| 950 | VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104009, |
| 951 | VK_COLOR_SPACE_BT2020_NONLINEAR_EXT = 1000104010, |
| 952 | VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011, |
| 953 | VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 954 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 955 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 956 | @extension("VK_EXT_debug_report") |
| 957 | enum VkDebugReportObjectTypeEXT { |
| 958 | VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, |
| 959 | VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, |
| 960 | VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, |
| 961 | VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, |
| 962 | VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, |
| 963 | VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, |
| 964 | VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, |
| 965 | VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, |
| 966 | VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, |
| 967 | VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, |
| 968 | VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, |
| 969 | VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, |
| 970 | VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, |
| 971 | VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, |
| 972 | VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, |
| 973 | VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, |
| 974 | VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, |
| 975 | VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, |
| 976 | VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, |
| 977 | VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, |
| 978 | VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, |
| 979 | VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, |
| 980 | VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, |
| 981 | VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, |
| 982 | VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, |
| 983 | VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, |
| 984 | VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, |
| 985 | VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, |
| 986 | VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28, |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 987 | VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, |
| 988 | VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, |
| 989 | VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31, |
| 990 | VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32, |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 991 | } |
| 992 | |
| 993 | @extension("VK_EXT_debug_report") |
| 994 | enum VkDebugReportErrorEXT { |
| 995 | VK_DEBUG_REPORT_ERROR_NONE_EXT = 0, |
| 996 | VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1, |
| 997 | } |
| 998 | |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 999 | @extension("VK_AMD_rasterization_order") |
| 1000 | enum VkRasterizationOrderAMD { |
| 1001 | VK_RASTERIZATION_ORDER_STRICT_AMD = 0, |
| 1002 | VK_RASTERIZATION_ORDER_RELAXED_AMD = 1, |
| 1003 | } |
| 1004 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 1005 | @extension("VK_EXT_validation_flags") |
| 1006 | enum VkValidationCheckEXT { |
| 1007 | VK_VALIDATION_CHECK_ALL_EXT = 0, |
| 1008 | } |
| 1009 | |
| 1010 | @extension("VK_NVX_device_generated_commands") |
| 1011 | enum VkIndirectCommandsTokenTypeNVX { |
| 1012 | VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0, |
| 1013 | VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1, |
| 1014 | VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2, |
| 1015 | VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3, |
| 1016 | VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4, |
| 1017 | VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5, |
| 1018 | VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6, |
| 1019 | VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7, |
| 1020 | } |
| 1021 | |
| 1022 | @extension("VK_NVX_device_generated_commands") |
| 1023 | enum VkObjectEntryTypeNVX { |
| 1024 | VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0, |
| 1025 | VK_OBJECT_ENTRY_PIPELINE_NVX = 1, |
| 1026 | VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2, |
| 1027 | VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3, |
| 1028 | VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4, |
| 1029 | } |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 1030 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1031 | ///////////////// |
| 1032 | // Bitfields // |
| 1033 | ///////////////// |
| 1034 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1035 | /// Queue capabilities |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1036 | type VkFlags VkQueueFlags |
| 1037 | bitfield VkQueueFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1038 | VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations |
| 1039 | VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1040 | VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1041 | 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] | 1042 | } |
| 1043 | |
| 1044 | /// Memory properties passed into vkAllocMemory(). |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1045 | type VkFlags VkMemoryPropertyFlags |
| 1046 | bitfield VkMemoryPropertyFlagBits { |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 1047 | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, |
| 1048 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, |
| 1049 | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, |
| 1050 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, |
| 1051 | VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1052 | } |
| 1053 | |
| 1054 | /// Memory heap flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1055 | type VkFlags VkMemoryHeapFlags |
| 1056 | bitfield VkMemoryHeapFlagBits { |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 1057 | VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1058 | } |
| 1059 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1060 | /// Access flags |
| 1061 | type VkFlags VkAccessFlags |
| 1062 | bitfield VkAccessFlagBits { |
| 1063 | VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, |
| 1064 | VK_ACCESS_INDEX_READ_BIT = 0x00000002, |
| 1065 | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, |
| 1066 | VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, |
| 1067 | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, |
| 1068 | VK_ACCESS_SHADER_READ_BIT = 0x00000020, |
| 1069 | VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, |
| 1070 | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, |
| 1071 | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, |
| 1072 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, |
| 1073 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, |
| 1074 | VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, |
| 1075 | VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, |
| 1076 | VK_ACCESS_HOST_READ_BIT = 0x00002000, |
| 1077 | VK_ACCESS_HOST_WRITE_BIT = 0x00004000, |
| 1078 | VK_ACCESS_MEMORY_READ_BIT = 0x00008000, |
| 1079 | VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 1080 | |
| 1081 | //@extension("VK_NVX_device_generated_commands") |
| 1082 | VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000, |
| 1083 | |
| 1084 | //@extension("VK_NVX_device_generated_commands") |
| 1085 | VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1086 | } |
| 1087 | |
| 1088 | /// Buffer usage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1089 | type VkFlags VkBufferUsageFlags |
| 1090 | bitfield VkBufferUsageFlagBits { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1091 | VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations |
| 1092 | 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] | 1093 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO |
| 1094 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO |
| 1095 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO |
| 1096 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO |
| 1097 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer) |
| 1098 | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO) |
| 1099 | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer) |
| 1100 | } |
| 1101 | |
| 1102 | /// Buffer creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1103 | type VkFlags VkBufferCreateFlags |
| 1104 | bitfield VkBufferCreateFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1105 | VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1106 | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency |
| 1107 | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers |
| 1108 | } |
| 1109 | |
| 1110 | /// Shader stage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1111 | type VkFlags VkShaderStageFlags |
| 1112 | bitfield VkShaderStageFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1113 | VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1114 | VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, |
| 1115 | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1116 | VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, |
| 1117 | VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, |
| 1118 | VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 1119 | VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1120 | |
| 1121 | VK_SHADER_STAGE_ALL = 0x7FFFFFFF, |
| 1122 | } |
| 1123 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1124 | /// Descriptor pool create flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1125 | type VkFlags VkDescriptorPoolCreateFlags |
| 1126 | bitfield VkDescriptorPoolCreateFlagBits { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1127 | VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, |
| 1128 | } |
| 1129 | |
| 1130 | /// Descriptor pool reset flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1131 | type VkFlags VkDescriptorPoolResetFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1132 | //bitfield VkDescriptorPoolResetFlagBits { |
| 1133 | //} |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1134 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1135 | /// Image usage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1136 | type VkFlags VkImageUsageFlags |
| 1137 | bitfield VkImageUsageFlagBits { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1138 | VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations |
| 1139 | 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] | 1140 | VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types) |
| 1141 | VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type) |
| 1142 | 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] | 1143 | 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] | 1144 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering |
| 1145 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment |
| 1146 | } |
| 1147 | |
| 1148 | /// Image creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1149 | type VkFlags VkImageCreateFlags |
| 1150 | bitfield VkImageCreateFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1151 | VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1152 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency |
| 1153 | 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] | 1154 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image |
| 1155 | 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] | 1156 | } |
| 1157 | |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1158 | /// Image view creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1159 | type VkFlags VkImageViewCreateFlags |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1160 | //bitfield VkImageViewCreateFlagBits { |
| 1161 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1162 | |
| 1163 | /// Pipeline creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1164 | type VkFlags VkPipelineCreateFlags |
| 1165 | bitfield VkPipelineCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1166 | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, |
| 1167 | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, |
| 1168 | VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, |
| 1169 | } |
| 1170 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1171 | /// Color component flags |
| 1172 | type VkFlags VkColorComponentFlags |
| 1173 | bitfield VkColorComponentFlagBits { |
| 1174 | VK_COLOR_COMPONENT_R_BIT = 0x00000001, |
| 1175 | VK_COLOR_COMPONENT_G_BIT = 0x00000002, |
| 1176 | VK_COLOR_COMPONENT_B_BIT = 0x00000004, |
| 1177 | VK_COLOR_COMPONENT_A_BIT = 0x00000008, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1178 | } |
| 1179 | |
| 1180 | /// Fence creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1181 | type VkFlags VkFenceCreateFlags |
| 1182 | bitfield VkFenceCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1183 | VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, |
| 1184 | } |
| 1185 | |
| 1186 | /// Semaphore creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1187 | type VkFlags VkSemaphoreCreateFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1188 | //bitfield VkSemaphoreCreateFlagBits { |
| 1189 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1190 | |
| 1191 | /// Format capability flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1192 | type VkFlags VkFormatFeatureFlags |
| 1193 | bitfield VkFormatFeatureFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1194 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types) |
| 1195 | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type) |
| 1196 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images |
| 1197 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs) |
| 1198 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs) |
| 1199 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers |
| 1200 | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs) |
| 1201 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images |
| 1202 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images |
| 1203 | 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] | 1204 | VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage |
| 1205 | 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] | 1206 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 1207 | |
| 1208 | //@extension("VK_IMG_filter_cubic") |
| 1209 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1210 | } |
| 1211 | |
| 1212 | /// Query control flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1213 | type VkFlags VkQueryControlFlags |
| 1214 | bitfield VkQueryControlFlagBits { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1215 | VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1216 | } |
| 1217 | |
| 1218 | /// Query result flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1219 | type VkFlags VkQueryResultFlags |
| 1220 | bitfield VkQueryResultFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1221 | VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values |
| 1222 | VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy |
| 1223 | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written |
| 1224 | VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available |
| 1225 | } |
| 1226 | |
| 1227 | /// Shader module creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1228 | type VkFlags VkShaderModuleCreateFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1229 | //bitfield VkShaderModuleCreateFlagBits { |
| 1230 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1231 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1232 | /// Event creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1233 | type VkFlags VkEventCreateFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1234 | //bitfield VkEventCreateFlagBits { |
| 1235 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1236 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1237 | /// Command buffer usage flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1238 | type VkFlags VkCommandBufferUsageFlags |
| 1239 | bitfield VkCommandBufferUsageFlagBits { |
| 1240 | VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, |
| 1241 | VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, |
| 1242 | VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1243 | } |
| 1244 | |
| 1245 | /// Pipeline statistics flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1246 | type VkFlags VkQueryPipelineStatisticFlags |
| 1247 | bitfield VkQueryPipelineStatisticFlagBits { |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1248 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional |
| 1249 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional |
| 1250 | VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional |
| 1251 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional |
| 1252 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional |
| 1253 | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional |
| 1254 | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional |
| 1255 | VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional |
| 1256 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional |
| 1257 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional |
| 1258 | VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1259 | } |
| 1260 | |
| 1261 | /// Memory mapping flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1262 | type VkFlags VkMemoryMapFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1263 | //bitfield VkMemoryMapFlagBits { |
| 1264 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1265 | |
| 1266 | /// Bitfield of image aspects |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1267 | type VkFlags VkImageAspectFlags |
| 1268 | bitfield VkImageAspectFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1269 | VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, |
| 1270 | VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, |
| 1271 | VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, |
| 1272 | VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, |
| 1273 | } |
| 1274 | |
| 1275 | /// Sparse memory bind flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1276 | type VkFlags VkSparseMemoryBindFlags |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 1277 | bitfield VkSparseMemoryBindFlagBits { |
| 1278 | VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001, |
| 1279 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1280 | |
| 1281 | /// Sparse image memory requirements flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1282 | type VkFlags VkSparseImageFormatFlags |
| 1283 | bitfield VkSparseImageFormatFlagBits { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1284 | VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices |
| 1285 | 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. |
| 1286 | 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] | 1287 | } |
| 1288 | |
| 1289 | /// Pipeline stages |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1290 | type VkFlags VkPipelineStageFlags |
| 1291 | bitfield VkPipelineStageFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1292 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed |
| 1293 | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch |
| 1294 | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch |
| 1295 | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1296 | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading |
| 1297 | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1298 | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading |
| 1299 | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading |
| 1300 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests |
| 1301 | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests |
| 1302 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes |
| 1303 | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading |
| 1304 | VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 1305 | VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, |
| 1306 | 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] | 1307 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 1308 | VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline |
| 1309 | 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] | 1310 | |
| 1311 | //@extension("VK_NVX_device_generated_commands") |
| 1312 | VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1313 | } |
| 1314 | |
| 1315 | /// Render pass attachment description flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1316 | type VkFlags VkAttachmentDescriptionFlags |
| 1317 | bitfield VkAttachmentDescriptionFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1318 | 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] | 1319 | } |
| 1320 | |
| 1321 | /// Subpass description flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1322 | type VkFlags VkSubpassDescriptionFlags |
| 1323 | bitfield VkSubpassDescriptionFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1324 | } |
| 1325 | |
| 1326 | /// Command pool creation flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1327 | type VkFlags VkCommandPoolCreateFlags |
| 1328 | bitfield VkCommandPoolCreateFlagBits { |
| 1329 | VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime |
| 1330 | 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] | 1331 | } |
| 1332 | |
| 1333 | /// Command pool reset flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1334 | type VkFlags VkCommandPoolResetFlags |
| 1335 | bitfield VkCommandPoolResetFlagBits { |
| 1336 | 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] | 1337 | } |
| 1338 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1339 | type VkFlags VkCommandBufferResetFlags |
| 1340 | bitfield VkCommandBufferResetFlagBits { |
| 1341 | 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] | 1342 | } |
| 1343 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1344 | type VkFlags VkSampleCountFlags |
| 1345 | bitfield VkSampleCountFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1346 | VK_SAMPLE_COUNT_1_BIT = 0x00000001, |
| 1347 | VK_SAMPLE_COUNT_2_BIT = 0x00000002, |
| 1348 | VK_SAMPLE_COUNT_4_BIT = 0x00000004, |
| 1349 | VK_SAMPLE_COUNT_8_BIT = 0x00000008, |
| 1350 | VK_SAMPLE_COUNT_16_BIT = 0x00000010, |
| 1351 | VK_SAMPLE_COUNT_32_BIT = 0x00000020, |
| 1352 | VK_SAMPLE_COUNT_64_BIT = 0x00000040, |
| 1353 | } |
| 1354 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1355 | type VkFlags VkStencilFaceFlags |
| 1356 | bitfield VkStencilFaceFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1357 | VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face |
| 1358 | VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 1359 | VK_STENCIL_FRONT_AND_BACK = 0x00000003, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1360 | } |
| 1361 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1362 | /// Instance creation flags |
| 1363 | type VkFlags VkInstanceCreateFlags |
| 1364 | //bitfield VkInstanceCreateFlagBits { |
| 1365 | //} |
| 1366 | |
| 1367 | /// Device creation flags |
| 1368 | type VkFlags VkDeviceCreateFlags |
| 1369 | //bitfield VkDeviceCreateFlagBits { |
| 1370 | //} |
| 1371 | |
| 1372 | /// Device queue creation flags |
| 1373 | type VkFlags VkDeviceQueueCreateFlags |
| 1374 | //bitfield VkDeviceQueueCreateFlagBits { |
| 1375 | //} |
| 1376 | |
| 1377 | /// Query pool creation flags |
| 1378 | type VkFlags VkQueryPoolCreateFlags |
| 1379 | //bitfield VkQueryPoolCreateFlagBits { |
| 1380 | //} |
| 1381 | |
| 1382 | /// Buffer view creation flags |
| 1383 | type VkFlags VkBufferViewCreateFlags |
| 1384 | //bitfield VkBufferViewCreateFlagBits { |
| 1385 | //} |
| 1386 | |
| 1387 | /// Pipeline cache creation flags |
| 1388 | type VkFlags VkPipelineCacheCreateFlags |
| 1389 | //bitfield VkPipelineCacheCreateFlagBits { |
| 1390 | //} |
| 1391 | |
| 1392 | /// Pipeline shader stage creation flags |
| 1393 | type VkFlags VkPipelineShaderStageCreateFlags |
| 1394 | //bitfield VkPipelineShaderStageCreateFlagBits { |
| 1395 | //} |
| 1396 | |
| 1397 | /// Descriptor set layout creation flags |
| 1398 | type VkFlags VkDescriptorSetLayoutCreateFlags |
| 1399 | //bitfield VkDescriptorSetLayoutCreateFlagBits { |
| 1400 | //} |
| 1401 | |
| 1402 | /// Pipeline vertex input state creation flags |
| 1403 | type VkFlags VkPipelineVertexInputStateCreateFlags |
| 1404 | //bitfield VkPipelineVertexInputStateCreateFlagBits { |
| 1405 | //} |
| 1406 | |
| 1407 | /// Pipeline input assembly state creation flags |
| 1408 | type VkFlags VkPipelineInputAssemblyStateCreateFlags |
| 1409 | //bitfield VkPipelineInputAssemblyStateCreateFlagBits { |
| 1410 | //} |
| 1411 | |
| 1412 | /// Tessellation state creation flags |
| 1413 | type VkFlags VkPipelineTessellationStateCreateFlags |
| 1414 | //bitfield VkPipelineTessellationStateCreateFlagBits { |
| 1415 | //} |
| 1416 | |
| 1417 | /// Viewport state creation flags |
| 1418 | type VkFlags VkPipelineViewportStateCreateFlags |
| 1419 | //bitfield VkPipelineViewportStateCreateFlagBits { |
| 1420 | //} |
| 1421 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1422 | /// Rasterization state creation flags |
| 1423 | type VkFlags VkPipelineRasterizationStateCreateFlags |
| 1424 | //bitfield VkPipelineRasterizationStateCreateFlagBits { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1425 | //} |
| 1426 | |
| 1427 | /// Multisample state creation flags |
| 1428 | type VkFlags VkPipelineMultisampleStateCreateFlags |
| 1429 | //bitfield VkPipelineMultisampleStateCreateFlagBits { |
| 1430 | //} |
| 1431 | |
| 1432 | /// Color blend state creation flags |
| 1433 | type VkFlags VkPipelineColorBlendStateCreateFlags |
| 1434 | //bitfield VkPipelineColorBlendStateCreateFlagBits { |
| 1435 | //} |
| 1436 | |
| 1437 | /// Depth/stencil state creation flags |
| 1438 | type VkFlags VkPipelineDepthStencilStateCreateFlags |
| 1439 | //bitfield VkPipelineDepthStencilStateCreateFlagBits { |
| 1440 | //} |
| 1441 | |
| 1442 | /// Dynamic state creation flags |
| 1443 | type VkFlags VkPipelineDynamicStateCreateFlags |
| 1444 | //bitfield VkPipelineDynamicStateCreateFlagBits { |
| 1445 | //} |
| 1446 | |
| 1447 | /// Pipeline layout creation flags |
| 1448 | type VkFlags VkPipelineLayoutCreateFlags |
| 1449 | //bitfield VkPipelineLayoutCreateFlagBits { |
| 1450 | //} |
| 1451 | |
| 1452 | /// Sampler creation flags |
| 1453 | type VkFlags VkSamplerCreateFlags |
| 1454 | //bitfield VkSamplerCreateFlagBits { |
| 1455 | //} |
| 1456 | |
| 1457 | /// Render pass creation flags |
| 1458 | type VkFlags VkRenderPassCreateFlags |
| 1459 | //bitfield VkRenderPassCreateFlagBits { |
| 1460 | //} |
| 1461 | |
| 1462 | /// Framebuffer creation flags |
| 1463 | type VkFlags VkFramebufferCreateFlags |
| 1464 | //bitfield VkFramebufferCreateFlagBits { |
| 1465 | //} |
| 1466 | |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 1467 | /// Dependency flags |
| 1468 | type VkFlags VkDependencyFlags |
| 1469 | bitfield VkDependencyFlagBits { |
| 1470 | VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, |
| 1471 | } |
| 1472 | |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 1473 | /// Cull mode flags |
| 1474 | type VkFlags VkCullModeFlags |
| 1475 | bitfield VkCullModeFlagBits { |
| 1476 | VK_CULL_MODE_NONE = 0x00000000, |
| 1477 | VK_CULL_MODE_FRONT_BIT = 0x00000001, |
| 1478 | VK_CULL_MODE_BACK_BIT = 0x00000002, |
| 1479 | VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, |
| 1480 | } |
| 1481 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1482 | @extension("VK_KHR_surface") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1483 | type VkFlags VkSurfaceTransformFlagsKHR |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1484 | @extension("VK_KHR_surface") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1485 | bitfield VkSurfaceTransformFlagBitsKHR { |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1486 | VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 1487 | VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, |
| 1488 | VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, |
| 1489 | VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, |
| 1490 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, |
| 1491 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, |
| 1492 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, |
| 1493 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, |
| 1494 | VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 1495 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1496 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1497 | @extension("VK_KHR_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1498 | type VkFlags VkCompositeAlphaFlagsKHR |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1499 | @extension("VK_KHR_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1500 | bitfield VkCompositeAlphaFlagBitsKHR { |
| 1501 | VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, |
| 1502 | VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, |
| 1503 | VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, |
| 1504 | VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, |
| 1505 | } |
| 1506 | |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1507 | @extension("VK_KHR_swapchain") |
| 1508 | type VkFlags VkSwapchainCreateFlagsKHR |
| 1509 | //@extension("VK_KHR_swapchain") |
| 1510 | //bitfield VkSwapchainCreateFlagBitsKHR { |
| 1511 | //} |
| 1512 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1513 | @extension("VK_KHR_display") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1514 | type VkFlags VkDisplayPlaneAlphaFlagsKHR |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1515 | @extension("VK_KHR_display") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1516 | bitfield VkDisplayPlaneAlphaFlagBitsKHR { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1517 | VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, |
| 1518 | VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002, |
| 1519 | VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004, |
| 1520 | VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 1521 | } |
| 1522 | |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1523 | @extension("VK_KHR_display") |
| 1524 | type VkFlags VkDisplaySurfaceCreateFlagsKHR |
| 1525 | //@extension("VK_KHR_display") |
| 1526 | //bitfield VkDisplaySurfaceCreateFlagBitsKHR { |
| 1527 | //} |
| 1528 | |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 1529 | @extension("VK_KHR_display") |
| 1530 | type VkFlags VkDisplayModeCreateFlagsKHR |
| 1531 | //@extension("VK_KHR_display") |
| 1532 | //bitfield VkDisplayModeCreateFlagBitsKHR { |
| 1533 | //} |
| 1534 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1535 | @extension("VK_KHR_xlib_surface") |
| 1536 | type VkFlags VkXlibSurfaceCreateFlagsKHR |
| 1537 | //@extension("VK_KHR_xlib_surface") |
| 1538 | //bitfield VkXlibSurfaceCreateFlagBitsKHR { |
| 1539 | //} |
| 1540 | |
| 1541 | @extension("VK_KHR_xcb_surface") |
| 1542 | type VkFlags VkXcbSurfaceCreateFlagsKHR |
| 1543 | //@extension("VK_KHR_xcb_surface") |
| 1544 | //bitfield VkXcbSurfaceCreateFlagBitsKHR { |
| 1545 | //} |
| 1546 | |
| 1547 | @extension("VK_KHR_wayland_surface") |
| 1548 | type VkFlags VkWaylandSurfaceCreateFlagsKHR |
| 1549 | //@extension("VK_KHR_wayland_surface") |
| 1550 | //bitfield VkWaylandSurfaceCreateFlagBitsKHR { |
| 1551 | //} |
| 1552 | |
| 1553 | @extension("VK_KHR_mir_surface") |
| 1554 | type VkFlags VkMirSurfaceCreateFlagsKHR |
| 1555 | //@extension("VK_KHR_mir_surface") |
| 1556 | //bitfield VkMirSurfaceCreateFlagBitsKHR { |
| 1557 | //} |
| 1558 | |
| 1559 | @extension("VK_KHR_android_surface") |
| 1560 | type VkFlags VkAndroidSurfaceCreateFlagsKHR |
| 1561 | //@extension("VK_KHR_android_surface") |
| 1562 | //bitfield VkAndroidSurfaceCreateFlagBitsKHR { |
| 1563 | //} |
| 1564 | |
| 1565 | @extension("VK_KHR_win32_surface") |
| 1566 | type VkFlags VkWin32SurfaceCreateFlagsKHR |
| 1567 | //@extension("VK_KHR_win32_surface") |
| 1568 | //bitfield VkWin32SurfaceCreateFlagBitsKHR { |
| 1569 | //} |
| 1570 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 1571 | @extension("VK_EXT_debug_report") |
| 1572 | type VkFlags VkDebugReportFlagsEXT |
| 1573 | @extension("VK_EXT_debug_report") |
| 1574 | bitfield VkDebugReportFlagBitsEXT { |
Jesse Hall | e2948d8 | 2016-02-25 04:19:32 -0800 | [diff] [blame] | 1575 | VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001, |
| 1576 | VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002, |
| 1577 | VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004, |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 1578 | VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008, |
| 1579 | VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010, |
| 1580 | } |
| 1581 | |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 1582 | @extension("VK_ANDROID_native_buffer") |
| 1583 | type VkFlags VkSwapchainImageUsageFlagsANDROID |
| 1584 | @extension("VK_ANDROID_native_buffer") |
| 1585 | bitfield VkSwapchainImageUsageFlagBitsANDROID { |
Chris Forbes | 4da65b9 | 2017-01-31 11:48:50 +1300 | [diff] [blame] | 1586 | VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_SHARED_BIT_ANDROID = 0x00000001, |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 1587 | } |
| 1588 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 1589 | @extension("VK_NV_external_memory_capabilities") |
| 1590 | type VkFlags VkExternalMemoryHandleTypeFlagsNV |
| 1591 | @extension("VK_NV_external_memory_capabilities") |
| 1592 | bitfield VkExternalMemoryHandleTypeFlagBitsNV { |
| 1593 | VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001, |
| 1594 | VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002, |
| 1595 | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004, |
| 1596 | VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008, |
| 1597 | } |
| 1598 | |
| 1599 | @extension("VK_NV_external_memory_capabilities") |
| 1600 | type VkFlags VkExternalMemoryFeatureFlagsNV |
| 1601 | @extension("VK_NV_external_memory_capabilities") |
| 1602 | bitfield VkExternalMemoryFeatureFlagBitsNV { |
| 1603 | VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001, |
| 1604 | VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002, |
| 1605 | VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004, |
| 1606 | } |
| 1607 | |
| 1608 | @extension("VK_NVX_device_generated_commands") |
| 1609 | type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX |
| 1610 | @extension("VK_NVX_device_generated_commands") |
| 1611 | bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX { |
| 1612 | VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001, |
| 1613 | VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002, |
| 1614 | VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004, |
| 1615 | VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008, |
| 1616 | } |
| 1617 | |
| 1618 | @extension("VK_NVX_device_generated_commands") |
| 1619 | type VkFlags VkObjectEntryUsageFlagsNVX |
| 1620 | @extension("VK_NVX_device_generated_commands") |
| 1621 | bitfield VkObjectEntryUsageFlagBitsNVX { |
| 1622 | VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001, |
| 1623 | VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002, |
| 1624 | } |
| 1625 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 1626 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1627 | ////////////////// |
| 1628 | // Structures // |
| 1629 | ////////////////// |
| 1630 | |
| 1631 | class VkOffset2D { |
| 1632 | s32 x |
| 1633 | s32 y |
| 1634 | } |
| 1635 | |
| 1636 | class VkOffset3D { |
| 1637 | s32 x |
| 1638 | s32 y |
| 1639 | s32 z |
| 1640 | } |
| 1641 | |
| 1642 | class VkExtent2D { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1643 | u32 width |
| 1644 | u32 height |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1645 | } |
| 1646 | |
| 1647 | class VkExtent3D { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1648 | u32 width |
| 1649 | u32 height |
| 1650 | u32 depth |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1651 | } |
| 1652 | |
| 1653 | class VkViewport { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1654 | f32 x |
| 1655 | f32 y |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1656 | f32 width |
| 1657 | f32 height |
| 1658 | f32 minDepth |
| 1659 | f32 maxDepth |
| 1660 | } |
| 1661 | |
| 1662 | class VkRect2D { |
| 1663 | VkOffset2D offset |
| 1664 | VkExtent2D extent |
| 1665 | } |
| 1666 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1667 | class VkClearRect { |
| 1668 | VkRect2D rect |
| 1669 | u32 baseArrayLayer |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1670 | u32 layerCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1671 | } |
| 1672 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1673 | class VkComponentMapping { |
| 1674 | VkComponentSwizzle r |
| 1675 | VkComponentSwizzle g |
| 1676 | VkComponentSwizzle b |
| 1677 | VkComponentSwizzle a |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1678 | } |
| 1679 | |
| 1680 | class VkPhysicalDeviceProperties { |
| 1681 | u32 apiVersion |
| 1682 | u32 driverVersion |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1683 | u32 vendorID |
| 1684 | u32 deviceID |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1685 | VkPhysicalDeviceType deviceType |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1686 | char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName |
| 1687 | u8[VK_UUID_SIZE] pipelineCacheUUID |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1688 | VkPhysicalDeviceLimits limits |
| 1689 | VkPhysicalDeviceSparseProperties sparseProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1690 | } |
| 1691 | |
| 1692 | class VkExtensionProperties { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1693 | char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1694 | u32 specVersion /// version of the extension specification implemented |
| 1695 | } |
| 1696 | |
| 1697 | class VkLayerProperties { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1698 | char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1699 | u32 specVersion /// version of the layer specification implemented |
| 1700 | u32 implementationVersion /// build or release version of the layer's library |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1701 | char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1702 | } |
| 1703 | |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1704 | class VkSubmitInfo { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1705 | VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO |
| 1706 | const void* pNext /// Next structure in chain |
| 1707 | u32 waitSemaphoreCount |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1708 | const VkSemaphore* pWaitSemaphores |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 1709 | const VkPipelineStageFlags* pWaitDstStageMask |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1710 | u32 commandBufferCount |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1711 | const VkCommandBuffer* pCommandBuffers |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1712 | u32 signalSemaphoreCount |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1713 | const VkSemaphore* pSignalSemaphores |
| 1714 | } |
| 1715 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1716 | class VkApplicationInfo { |
| 1717 | VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO |
| 1718 | const void* pNext /// Next structure in chain |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1719 | const char* pApplicationName |
| 1720 | u32 applicationVersion |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1721 | const char* pEngineName |
| 1722 | u32 engineVersion |
| 1723 | u32 apiVersion |
| 1724 | } |
| 1725 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1726 | class VkAllocationCallbacks { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1727 | void* pUserData |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1728 | PFN_vkAllocationFunction pfnAllocation |
| 1729 | PFN_vkReallocationFunction pfnReallocation |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1730 | PFN_vkFreeFunction pfnFree |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1731 | PFN_vkInternalAllocationNotification pfnInternalAllocation |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1732 | PFN_vkInternalFreeNotification pfnInternalFree |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1733 | } |
| 1734 | |
| 1735 | class VkDeviceQueueCreateInfo { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1736 | VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO |
| 1737 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1738 | VkDeviceQueueCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1739 | u32 queueFamilyIndex |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 1740 | u32 queueCount |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1741 | const f32* pQueuePriorities |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1742 | } |
| 1743 | |
| 1744 | class VkDeviceCreateInfo { |
| 1745 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO |
| 1746 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1747 | VkDeviceCreateFlags flags |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 1748 | u32 queueCreateInfoCount |
| 1749 | const VkDeviceQueueCreateInfo* pQueueCreateInfos |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1750 | u32 enabledLayerCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1751 | const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1752 | u32 enabledExtensionCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1753 | const char* const* ppEnabledExtensionNames |
| 1754 | const VkPhysicalDeviceFeatures* pEnabledFeatures |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1755 | } |
| 1756 | |
| 1757 | class VkInstanceCreateInfo { |
| 1758 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO |
| 1759 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1760 | VkInstanceCreateFlags flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1761 | const VkApplicationInfo* pApplicationInfo |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1762 | u32 enabledLayerCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1763 | const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 1764 | u32 enabledExtensionCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1765 | const char* const* ppEnabledExtensionNames /// Extension names to be enabled |
| 1766 | } |
| 1767 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1768 | class VkQueueFamilyProperties { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1769 | VkQueueFlags queueFlags /// Queue flags |
| 1770 | u32 queueCount |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 1771 | u32 timestampValidBits |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1772 | VkExtent3D minImageTransferGranularity |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1773 | } |
| 1774 | |
| 1775 | class VkPhysicalDeviceMemoryProperties { |
| 1776 | u32 memoryTypeCount |
| 1777 | VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes |
| 1778 | u32 memoryHeapCount |
| 1779 | VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps |
| 1780 | } |
| 1781 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1782 | class VkMemoryAllocateInfo { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1783 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1784 | const void* pNext /// Pointer to next structure |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1785 | VkDeviceSize allocationSize /// Size of memory allocation |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1786 | u32 memoryTypeIndex /// Index of the of the memory type to allocate from |
| 1787 | } |
| 1788 | |
| 1789 | class VkMemoryRequirements { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1790 | VkDeviceSize size /// Specified in bytes |
| 1791 | VkDeviceSize alignment /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1792 | u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object |
| 1793 | } |
| 1794 | |
| 1795 | class VkSparseImageFormatProperties { |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1796 | VkImageAspectFlagBits aspectMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1797 | VkExtent3D imageGranularity |
| 1798 | VkSparseImageFormatFlags flags |
| 1799 | } |
| 1800 | |
| 1801 | class VkSparseImageMemoryRequirements { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1802 | VkSparseImageFormatProperties formatProperties |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1803 | u32 imageMipTailFirstLod |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1804 | VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment |
| 1805 | VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment |
| 1806 | 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] | 1807 | } |
| 1808 | |
| 1809 | class VkMemoryType { |
| 1810 | VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type |
| 1811 | u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from |
| 1812 | } |
| 1813 | |
| 1814 | class VkMemoryHeap { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1815 | VkDeviceSize size /// Available memory in the heap |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1816 | VkMemoryHeapFlags flags /// Flags for the heap |
| 1817 | } |
| 1818 | |
| 1819 | class VkMappedMemoryRange { |
| 1820 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE |
| 1821 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1822 | VkDeviceMemory memory /// Mapped memory object |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1823 | VkDeviceSize offset /// Offset within the mapped memory the range starts from |
| 1824 | VkDeviceSize size /// Size of the range within the mapped memory |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1825 | } |
| 1826 | |
| 1827 | class VkFormatProperties { |
| 1828 | VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling |
| 1829 | VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1830 | VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1831 | } |
| 1832 | |
| 1833 | class VkImageFormatProperties { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1834 | VkExtent3D maxExtent /// max image dimensions for this resource type |
| 1835 | u32 maxMipLevels /// max number of mipmap levels for this resource type |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1836 | u32 maxArrayLayers /// max array layers for this resource type |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1837 | VkSampleCountFlags sampleCounts /// supported sample counts for this resource type |
| 1838 | VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type |
| 1839 | } |
| 1840 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1841 | class VkDescriptorImageInfo { |
| 1842 | VkSampler sampler |
| 1843 | VkImageView imageView |
| 1844 | VkImageLayout imageLayout |
| 1845 | } |
| 1846 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1847 | class VkDescriptorBufferInfo { |
| 1848 | VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC] |
| 1849 | VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set. |
| 1850 | 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] | 1851 | } |
| 1852 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1853 | class VkWriteDescriptorSet { |
| 1854 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET |
| 1855 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1856 | VkDescriptorSet dstSet /// Destination descriptor set |
| 1857 | u32 dstBinding /// Binding within the destination descriptor set to write |
| 1858 | u32 dstArrayElement /// Array element within the destination binding to write |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1859 | 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] | 1860 | 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] | 1861 | const VkDescriptorImageInfo* pImageInfo |
| 1862 | const VkDescriptorBufferInfo* pBufferInfo |
| 1863 | const VkBufferView* pTexelBufferView |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1864 | } |
| 1865 | |
| 1866 | class VkCopyDescriptorSet { |
| 1867 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET |
| 1868 | const void* pNext /// Pointer to next structure |
| 1869 | VkDescriptorSet srcSet /// Source descriptor set |
| 1870 | u32 srcBinding /// Binding within the source descriptor set to copy from |
| 1871 | u32 srcArrayElement /// Array element within the source binding to copy from |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1872 | VkDescriptorSet dstSet /// Destination descriptor set |
| 1873 | u32 dstBinding /// Binding within the destination descriptor set to copy to |
| 1874 | u32 dstArrayElement /// Array element within the destination binding to copy to |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1875 | u32 descriptorCount /// Number of descriptors to copy |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1876 | } |
| 1877 | |
| 1878 | class VkBufferCreateInfo { |
| 1879 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO |
| 1880 | const void* pNext /// Pointer to next structure. |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1881 | VkBufferCreateFlags flags /// Buffer creation flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1882 | VkDeviceSize size /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1883 | VkBufferUsageFlags usage /// Buffer usage flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1884 | VkSharingMode sharingMode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1885 | u32 queueFamilyIndexCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1886 | const u32* pQueueFamilyIndices |
| 1887 | } |
| 1888 | |
| 1889 | class VkBufferViewCreateInfo { |
| 1890 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO |
| 1891 | const void* pNext /// Pointer to next structure. |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1892 | VkBufferViewCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1893 | VkBuffer buffer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1894 | VkFormat format /// Optionally specifies format of elements |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1895 | VkDeviceSize offset /// Specified in bytes |
| 1896 | VkDeviceSize range /// View size specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1897 | } |
| 1898 | |
| 1899 | class VkImageSubresource { |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1900 | VkImageAspectFlagBits aspectMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1901 | u32 mipLevel |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1902 | u32 arrayLayer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1903 | } |
| 1904 | |
| 1905 | class VkImageSubresourceRange { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1906 | VkImageAspectFlags aspectMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1907 | u32 baseMipLevel |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1908 | u32 levelCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1909 | u32 baseArrayLayer |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1910 | u32 layerCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1911 | } |
| 1912 | |
| 1913 | class VkMemoryBarrier { |
| 1914 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER |
| 1915 | const void* pNext /// Pointer to next structure. |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1916 | VkAccessFlags srcAccessMask |
| 1917 | VkAccessFlags dstAccessMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1918 | } |
| 1919 | |
| 1920 | class VkBufferMemoryBarrier { |
| 1921 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER |
| 1922 | const void* pNext /// Pointer to next structure. |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1923 | VkAccessFlags srcAccessMask |
| 1924 | VkAccessFlags dstAccessMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1925 | u32 srcQueueFamilyIndex /// Queue family to transition ownership from |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1926 | u32 dstQueueFamilyIndex /// Queue family to transition ownership to |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1927 | VkBuffer buffer /// Buffer to sync |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1928 | VkDeviceSize offset /// Offset within the buffer to sync |
| 1929 | VkDeviceSize size /// Amount of bytes to sync |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1930 | } |
| 1931 | |
| 1932 | class VkImageMemoryBarrier { |
| 1933 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER |
| 1934 | const void* pNext /// Pointer to next structure. |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1935 | VkAccessFlags srcAccessMask |
| 1936 | VkAccessFlags dstAccessMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1937 | VkImageLayout oldLayout /// Current layout of the image |
| 1938 | VkImageLayout newLayout /// New layout to transition the image to |
| 1939 | u32 srcQueueFamilyIndex /// Queue family to transition ownership from |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1940 | u32 dstQueueFamilyIndex /// Queue family to transition ownership to |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1941 | VkImage image /// Image to sync |
| 1942 | VkImageSubresourceRange subresourceRange /// Subresource range to sync |
| 1943 | } |
| 1944 | |
| 1945 | class VkImageCreateInfo { |
| 1946 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO |
| 1947 | const void* pNext /// Pointer to next structure. |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1948 | VkImageCreateFlags flags /// Image creation flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1949 | VkImageType imageType |
| 1950 | VkFormat format |
| 1951 | VkExtent3D extent |
| 1952 | u32 mipLevels |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1953 | u32 arrayLayers |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 1954 | VkSampleCountFlagBits samples |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1955 | VkImageTiling tiling |
| 1956 | VkImageUsageFlags usage /// Image usage flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1957 | VkSharingMode sharingMode /// Cross-queue-family sharing mode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1958 | u32 queueFamilyIndexCount /// Number of queue families to share across |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1959 | const u32* pQueueFamilyIndices /// Array of queue family indices to share across |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1960 | VkImageLayout initialLayout /// Initial image layout for all subresources |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1961 | } |
| 1962 | |
| 1963 | class VkSubresourceLayout { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1964 | VkDeviceSize offset /// Specified in bytes |
| 1965 | VkDeviceSize size /// Specified in bytes |
| 1966 | VkDeviceSize rowPitch /// Specified in bytes |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 1967 | VkDeviceSize arrayPitch /// Specified in bytes |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1968 | VkDeviceSize depthPitch /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1969 | } |
| 1970 | |
| 1971 | class VkImageViewCreateInfo { |
| 1972 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO |
| 1973 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1974 | VkImageViewCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1975 | VkImage image |
| 1976 | VkImageViewType viewType |
| 1977 | VkFormat format |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1978 | VkComponentMapping components |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1979 | VkImageSubresourceRange subresourceRange |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1980 | } |
| 1981 | |
| 1982 | class VkBufferCopy { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1983 | VkDeviceSize srcOffset /// Specified in bytes |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1984 | VkDeviceSize dstOffset /// Specified in bytes |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1985 | VkDeviceSize size /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1986 | } |
| 1987 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1988 | class VkSparseMemoryBind { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1989 | VkDeviceSize resourceOffset /// Specified in bytes |
| 1990 | VkDeviceSize size /// Specified in bytes |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1991 | VkDeviceMemory memory |
| 1992 | VkDeviceSize memoryOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1993 | VkSparseMemoryBindFlags flags |
| 1994 | } |
| 1995 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1996 | class VkSparseImageMemoryBind { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1997 | VkImageSubresource subresource |
| 1998 | VkOffset3D offset |
| 1999 | VkExtent3D extent |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2000 | VkDeviceMemory memory |
| 2001 | VkDeviceSize memoryOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2002 | VkSparseMemoryBindFlags flags |
| 2003 | } |
| 2004 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2005 | class VkSparseBufferMemoryBindInfo { |
| 2006 | VkBuffer buffer |
| 2007 | u32 bindCount |
| 2008 | const VkSparseMemoryBind* pBinds |
| 2009 | } |
| 2010 | |
| 2011 | class VkSparseImageOpaqueMemoryBindInfo { |
| 2012 | VkImage image |
| 2013 | u32 bindCount |
| 2014 | const VkSparseMemoryBind* pBinds |
| 2015 | } |
| 2016 | |
| 2017 | class VkSparseImageMemoryBindInfo { |
| 2018 | VkImage image |
| 2019 | u32 bindCount |
| 2020 | const VkSparseMemoryBind* pBinds |
| 2021 | } |
| 2022 | |
| 2023 | class VkBindSparseInfo { |
| 2024 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO |
| 2025 | const void* pNext |
| 2026 | u32 waitSemaphoreCount |
| 2027 | const VkSemaphore* pWaitSemaphores |
| 2028 | u32 numBufferBinds |
| 2029 | const VkSparseBufferMemoryBindInfo* pBufferBinds |
| 2030 | u32 numImageOpaqueBinds |
| 2031 | const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds |
| 2032 | u32 numImageBinds |
| 2033 | const VkSparseImageMemoryBindInfo* pImageBinds |
| 2034 | u32 signalSemaphoreCount |
| 2035 | const VkSemaphore* pSignalSemaphores |
| 2036 | } |
| 2037 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2038 | class VkImageSubresourceLayers { |
| 2039 | VkImageAspectFlags aspectMask |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2040 | u32 mipLevel |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 2041 | u32 baseArrayLayer |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2042 | u32 layerCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2043 | } |
| 2044 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2045 | class VkImageCopy { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2046 | VkImageSubresourceLayers srcSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2047 | VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2048 | VkImageSubresourceLayers dstSubresource |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2049 | VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2050 | VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images |
| 2051 | } |
| 2052 | |
| 2053 | class VkImageBlit { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2054 | VkImageSubresourceLayers srcSubresource |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2055 | VkOffset3D[2] srcOffsets |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2056 | VkImageSubresourceLayers dstSubresource |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2057 | VkOffset3D[2] dstOffsets |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2058 | } |
| 2059 | |
| 2060 | class VkBufferImageCopy { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2061 | VkDeviceSize bufferOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2062 | u32 bufferRowLength /// Specified in texels |
| 2063 | u32 bufferImageHeight |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2064 | VkImageSubresourceLayers imageSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2065 | VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images |
| 2066 | VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images |
| 2067 | } |
| 2068 | |
| 2069 | class VkImageResolve { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2070 | VkImageSubresourceLayers srcSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2071 | VkOffset3D srcOffset |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2072 | VkImageSubresourceLayers dstSubresource |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2073 | VkOffset3D dstOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2074 | VkExtent3D extent |
| 2075 | } |
| 2076 | |
| 2077 | class VkShaderModuleCreateInfo { |
| 2078 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO |
| 2079 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2080 | VkShaderModuleCreateFlags flags /// Reserved |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2081 | platform.size_t codeSize /// Specified in bytes |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2082 | const u32* pCode /// Binary code of size codeSize |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2083 | } |
| 2084 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2085 | class VkDescriptorSetLayoutBinding { |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2086 | u32 binding |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2087 | VkDescriptorType descriptorType /// Type of the descriptors in this binding |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 2088 | u32 descriptorCount /// Number of descriptors in this binding |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2089 | VkShaderStageFlags stageFlags /// Shader stages this binding is visible to |
| 2090 | const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements) |
| 2091 | } |
| 2092 | |
| 2093 | class VkDescriptorSetLayoutCreateInfo { |
| 2094 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO |
| 2095 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2096 | VkDescriptorSetLayoutCreateFlags flags |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2097 | u32 bindingCount /// Number of bindings in the descriptor set layout |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 2098 | const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2099 | } |
| 2100 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2101 | class VkDescriptorPoolSize { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2102 | VkDescriptorType type |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2103 | u32 descriptorCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2104 | } |
| 2105 | |
| 2106 | class VkDescriptorPoolCreateInfo { |
| 2107 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO |
| 2108 | const void* pNext /// Pointer to next structure |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2109 | VkDescriptorPoolCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2110 | u32 maxSets |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2111 | u32 poolSizeCount |
| 2112 | const VkDescriptorPoolSize* pPoolSizes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2113 | } |
| 2114 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2115 | class VkDescriptorSetAllocateInfo { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2116 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2117 | const void* pNext /// Pointer to next structure |
| 2118 | VkDescriptorPool descriptorPool |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2119 | u32 setCount |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2120 | const VkDescriptorSetLayout* pSetLayouts |
| 2121 | } |
| 2122 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2123 | class VkSpecializationMapEntry { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2124 | u32 constantID /// The SpecConstant ID specified in the BIL |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2125 | u32 offset /// Offset of the value in the data block |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2126 | platform.size_t size /// Size in bytes of the SpecConstant |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2127 | } |
| 2128 | |
| 2129 | class VkSpecializationInfo { |
| 2130 | u32 mapEntryCount /// Number of entries in the map |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2131 | const VkSpecializationMapEntry* pMapEntries /// Array of map entries |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2132 | platform.size_t dataSize /// Size in bytes of pData |
| 2133 | const void* pData /// Pointer to SpecConstant data |
| 2134 | } |
| 2135 | |
| 2136 | class VkPipelineShaderStageCreateInfo { |
| 2137 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO |
| 2138 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2139 | VkPipelineShaderStageCreateFlags flags |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2140 | VkShaderStageFlagBits stage |
| 2141 | VkShaderModule module |
| 2142 | const char* pName |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2143 | const VkSpecializationInfo* pSpecializationInfo |
| 2144 | } |
| 2145 | |
| 2146 | class VkComputePipelineCreateInfo { |
| 2147 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO |
| 2148 | const void* pNext /// Pointer to next structure |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2149 | VkPipelineCreateFlags flags /// Pipeline creation flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2150 | VkPipelineShaderStageCreateInfo stage |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2151 | VkPipelineLayout layout /// Interface layout of the pipeline |
| 2152 | 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 |
| 2153 | 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 |
| 2154 | } |
| 2155 | |
| 2156 | class VkVertexInputBindingDescription { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2157 | u32 binding /// Vertex buffer binding id |
| 2158 | u32 stride /// Distance between vertices in bytes (0 = no advancement) |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2159 | VkVertexInputRate inputRate /// Rate at which binding is incremented |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2160 | } |
| 2161 | |
| 2162 | class VkVertexInputAttributeDescription { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2163 | u32 location /// location of the shader vertex attrib |
| 2164 | u32 binding /// Vertex buffer binding id |
| 2165 | VkFormat format /// format of source data |
| 2166 | u32 offset /// Offset of first element in bytes from base of vertex |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2167 | } |
| 2168 | |
| 2169 | class VkPipelineVertexInputStateCreateInfo { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2170 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO |
| 2171 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2172 | VkPipelineVertexInputStateCreateFlags flags |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2173 | u32 vertexBindingDescriptionCount /// number of bindings |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2174 | const VkVertexInputBindingDescription* pVertexBindingDescriptions |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2175 | u32 vertexAttributeDescriptionCount /// number of attributes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2176 | const VkVertexInputAttributeDescription* pVertexAttributeDescriptions |
| 2177 | } |
| 2178 | |
| 2179 | class VkPipelineInputAssemblyStateCreateInfo { |
| 2180 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO |
| 2181 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2182 | VkPipelineInputAssemblyStateCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2183 | VkPrimitiveTopology topology |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2184 | VkBool32 primitiveRestartEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2185 | } |
| 2186 | |
| 2187 | class VkPipelineTessellationStateCreateInfo { |
| 2188 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO |
| 2189 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2190 | VkPipelineTessellationStateCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2191 | u32 patchControlPoints |
| 2192 | } |
| 2193 | |
| 2194 | class VkPipelineViewportStateCreateInfo { |
| 2195 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO |
| 2196 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2197 | VkPipelineViewportStateCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2198 | u32 viewportCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2199 | const VkViewport* pViewports |
| 2200 | u32 scissorCount |
| 2201 | const VkRect2D* pScissors |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2202 | } |
| 2203 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2204 | class VkPipelineRasterizationStateCreateInfo { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2205 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2206 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2207 | VkPipelineRasterizationStateCreateFlags flags |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2208 | VkBool32 depthClampEnable |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2209 | VkBool32 rasterizerDiscardEnable |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2210 | VkPolygonMode polygonMode /// optional (GL45) |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 2211 | VkCullModeFlags cullMode |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2212 | VkFrontFace frontFace |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2213 | VkBool32 depthBiasEnable |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2214 | f32 depthBiasConstantFactor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2215 | f32 depthBiasClamp |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2216 | f32 depthBiasSlopeFactor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2217 | f32 lineWidth |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2218 | } |
| 2219 | |
| 2220 | class VkPipelineMultisampleStateCreateInfo { |
| 2221 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO |
| 2222 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2223 | VkPipelineMultisampleStateCreateFlags flags |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2224 | VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2225 | VkBool32 sampleShadingEnable /// optional (GL45) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2226 | f32 minSampleShading /// optional (GL45) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2227 | const VkSampleMask* pSampleMask |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 2228 | VkBool32 alphaToCoverageEnable |
| 2229 | VkBool32 alphaToOneEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2230 | } |
| 2231 | |
| 2232 | class VkPipelineColorBlendAttachmentState { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2233 | VkBool32 blendEnable |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2234 | VkBlendFactor srcColorBlendFactor |
| 2235 | VkBlendFactor dstColorBlendFactor |
| 2236 | VkBlendOp colorBlendOp |
| 2237 | VkBlendFactor srcAlphaBlendFactor |
| 2238 | VkBlendFactor dstAlphaBlendFactor |
| 2239 | VkBlendOp alphaBlendOp |
| 2240 | VkColorComponentFlags colorWriteMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2241 | } |
| 2242 | |
| 2243 | class VkPipelineColorBlendStateCreateInfo { |
| 2244 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO |
| 2245 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2246 | VkPipelineColorBlendStateCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2247 | VkBool32 logicOpEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2248 | VkLogicOp logicOp |
| 2249 | u32 attachmentCount /// # of pAttachments |
| 2250 | const VkPipelineColorBlendAttachmentState* pAttachments |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2251 | f32[4] blendConstants |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2252 | } |
| 2253 | |
| 2254 | class VkStencilOpState { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2255 | VkStencilOp failOp |
| 2256 | VkStencilOp passOp |
| 2257 | VkStencilOp depthFailOp |
| 2258 | VkCompareOp compareOp |
| 2259 | u32 compareMask |
| 2260 | u32 writeMask |
| 2261 | u32 reference |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2262 | } |
| 2263 | |
| 2264 | class VkPipelineDepthStencilStateCreateInfo { |
| 2265 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO |
| 2266 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2267 | VkPipelineDepthStencilStateCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2268 | VkBool32 depthTestEnable |
| 2269 | VkBool32 depthWriteEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2270 | VkCompareOp depthCompareOp |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2271 | VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test) |
| 2272 | VkBool32 stencilTestEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2273 | VkStencilOpState front |
| 2274 | VkStencilOpState back |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2275 | f32 minDepthBounds |
| 2276 | f32 maxDepthBounds |
| 2277 | } |
| 2278 | |
| 2279 | class VkPipelineDynamicStateCreateInfo { |
| 2280 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO |
| 2281 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2282 | VkPipelineDynamicStateCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2283 | u32 dynamicStateCount |
| 2284 | const VkDynamicState* pDynamicStates |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2285 | } |
| 2286 | |
| 2287 | class VkGraphicsPipelineCreateInfo { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2288 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO |
| 2289 | const void* pNext /// Pointer to next structure |
| 2290 | VkPipelineCreateFlags flags /// Pipeline creation flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2291 | u32 stageCount |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2292 | const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2293 | const VkPipelineVertexInputStateCreateInfo* pVertexInputState |
| 2294 | const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState |
| 2295 | const VkPipelineTessellationStateCreateInfo* pTessellationState |
| 2296 | const VkPipelineViewportStateCreateInfo* pViewportState |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2297 | const VkPipelineRasterizationStateCreateInfo* pRasterizationState |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2298 | const VkPipelineMultisampleStateCreateInfo* pMultisampleState |
| 2299 | const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState |
| 2300 | const VkPipelineColorBlendStateCreateInfo* pColorBlendState |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2301 | const VkPipelineDynamicStateCreateInfo* pDynamicState |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2302 | VkPipelineLayout layout /// Interface layout of the pipeline |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2303 | VkRenderPass renderPass |
| 2304 | u32 subpass |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2305 | 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 |
| 2306 | 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] | 2307 | } |
| 2308 | |
| 2309 | class VkPipelineCacheCreateInfo { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2310 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO |
| 2311 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2312 | VkPipelineCacheCreateFlags flags |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2313 | platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes |
| 2314 | const void* pInitialData /// Initial data to populate cache |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2315 | } |
| 2316 | |
| 2317 | class VkPushConstantRange { |
| 2318 | VkShaderStageFlags stageFlags /// Which stages use the range |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2319 | u32 offset /// Start of the range, in bytes |
| 2320 | u32 size /// Length of the range, in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2321 | } |
| 2322 | |
| 2323 | class VkPipelineLayoutCreateInfo { |
| 2324 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO |
| 2325 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2326 | VkPipelineLayoutCreateFlags flags |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2327 | u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2328 | const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the |
| 2329 | u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline |
| 2330 | const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages |
| 2331 | } |
| 2332 | |
| 2333 | class VkSamplerCreateInfo { |
| 2334 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO |
| 2335 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2336 | VkSamplerCreateFlags flags |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 2337 | VkFilter magFilter /// Filter mode for magnification |
| 2338 | VkFilter minFilter /// Filter mode for minifiation |
| 2339 | VkSamplerMipmapMode mipmapMode /// Mipmap selection mode |
| 2340 | VkSamplerAddressMode addressModeU |
| 2341 | VkSamplerAddressMode addressModeV |
| 2342 | VkSamplerAddressMode addressModeW |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2343 | f32 mipLodBias |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2344 | VkBool32 anisotropyEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2345 | f32 maxAnisotropy |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2346 | VkBool32 compareEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2347 | VkCompareOp compareOp |
| 2348 | f32 minLod |
| 2349 | f32 maxLod |
| 2350 | VkBorderColor borderColor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2351 | VkBool32 unnormalizedCoordinates |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2352 | } |
| 2353 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2354 | class VkCommandPoolCreateInfo { |
| 2355 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2356 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2357 | VkCommandPoolCreateFlags flags /// Command pool creation flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2358 | u32 queueFamilyIndex |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2359 | } |
| 2360 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2361 | class VkCommandBufferAllocateInfo { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2362 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2363 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2364 | VkCommandPool commandPool |
| 2365 | VkCommandBufferLevel level |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2366 | u32 commandBufferCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2367 | } |
| 2368 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2369 | class VkCommandBufferInheritanceInfo { |
| 2370 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2371 | const void* pNext /// Pointer to next structure |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2372 | VkRenderPass renderPass /// Render pass for secondary command buffers |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2373 | u32 subpass |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2374 | VkFramebuffer framebuffer /// Framebuffer for secondary command buffers |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2375 | VkBool32 occlusionQueryEnable |
| 2376 | VkQueryControlFlags queryFlags |
| 2377 | VkQueryPipelineStatisticFlags pipelineStatistics |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2378 | } |
| 2379 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2380 | class VkCommandBufferBeginInfo { |
| 2381 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO |
| 2382 | const void* pNext /// Pointer to next structure |
| 2383 | VkCommandBufferUsageFlags flags /// Command buffer usage flags |
| 2384 | const VkCommandBufferInheritanceInfo* pInheritanceInfo |
| 2385 | } |
| 2386 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2387 | class VkRenderPassBeginInfo { |
| 2388 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO |
| 2389 | const void* pNext /// Pointer to next structure |
| 2390 | VkRenderPass renderPass |
| 2391 | VkFramebuffer framebuffer |
| 2392 | VkRect2D renderArea |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2393 | u32 clearValueCount |
| 2394 | const VkClearValue* pClearValues |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2395 | } |
| 2396 | |
| 2397 | @union |
| 2398 | /// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared. |
| 2399 | class VkClearColorValue { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2400 | f32[4] float32 |
| 2401 | s32[4] int32 |
| 2402 | u32[4] uint32 |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2403 | } |
| 2404 | |
| 2405 | class VkClearDepthStencilValue { |
| 2406 | f32 depth |
| 2407 | u32 stencil |
| 2408 | } |
| 2409 | |
| 2410 | @union |
| 2411 | /// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared. |
| 2412 | class VkClearValue { |
| 2413 | VkClearColorValue color |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2414 | VkClearDepthStencilValue depthStencil |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2415 | } |
| 2416 | |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2417 | class VkClearAttachment { |
| 2418 | VkImageAspectFlags aspectMask |
| 2419 | u32 colorAttachment |
| 2420 | VkClearValue clearValue |
| 2421 | } |
| 2422 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2423 | class VkAttachmentDescription { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2424 | VkAttachmentDescriptionFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2425 | VkFormat format |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2426 | VkSampleCountFlagBits samples |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2427 | VkAttachmentLoadOp loadOp /// Load op for color or depth data |
| 2428 | VkAttachmentStoreOp storeOp /// Store op for color or depth data |
| 2429 | VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data |
| 2430 | VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data |
| 2431 | VkImageLayout initialLayout |
| 2432 | VkImageLayout finalLayout |
| 2433 | } |
| 2434 | |
| 2435 | class VkAttachmentReference { |
| 2436 | u32 attachment |
| 2437 | VkImageLayout layout |
| 2438 | } |
| 2439 | |
| 2440 | class VkSubpassDescription { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2441 | VkSubpassDescriptionFlags flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2442 | VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2443 | u32 inputAttachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2444 | const VkAttachmentReference* pInputAttachments |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2445 | u32 colorAttachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2446 | const VkAttachmentReference* pColorAttachments |
| 2447 | const VkAttachmentReference* pResolveAttachments |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 2448 | const VkAttachmentReference* pDepthStencilAttachment |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2449 | u32 preserveAttachmentCount |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2450 | const u32* pPreserveAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2451 | } |
| 2452 | |
| 2453 | class VkSubpassDependency { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2454 | u32 srcSubpass |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2455 | u32 dstSubpass |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2456 | VkPipelineStageFlags srcStageMask |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2457 | VkPipelineStageFlags dstStageMask |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2458 | VkAccessFlags srcAccessMask |
| 2459 | VkAccessFlags dstAccessMask |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 2460 | VkDependencyFlags dependencyFlags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2461 | } |
| 2462 | |
| 2463 | class VkRenderPassCreateInfo { |
| 2464 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO |
| 2465 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2466 | VkRenderPassCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2467 | u32 attachmentCount |
| 2468 | const VkAttachmentDescription* pAttachments |
| 2469 | u32 subpassCount |
| 2470 | const VkSubpassDescription* pSubpasses |
| 2471 | u32 dependencyCount |
| 2472 | const VkSubpassDependency* pDependencies |
| 2473 | } |
| 2474 | |
| 2475 | class VkEventCreateInfo { |
| 2476 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO |
| 2477 | const void* pNext /// Pointer to next structure |
| 2478 | VkEventCreateFlags flags /// Event creation flags |
| 2479 | } |
| 2480 | |
| 2481 | class VkFenceCreateInfo { |
| 2482 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO |
| 2483 | const void* pNext /// Pointer to next structure |
| 2484 | VkFenceCreateFlags flags /// Fence creation flags |
| 2485 | } |
| 2486 | |
| 2487 | class VkPhysicalDeviceFeatures { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2488 | VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined |
| 2489 | VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls |
| 2490 | VkBool32 imageCubeArray /// image views which are arrays of cube maps |
| 2491 | VkBool32 independentBlend /// blending operations are controlled per-attachment |
| 2492 | VkBool32 geometryShader /// geometry stage |
| 2493 | VkBool32 tessellationShader /// tessellation control and evaluation stage |
| 2494 | VkBool32 sampleRateShading /// per-sample shading and interpolation |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2495 | VkBool32 dualSrcBlend /// blend operations which take two sources |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2496 | VkBool32 logicOp /// logic operations |
| 2497 | VkBool32 multiDrawIndirect /// multi draw indirect |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame] | 2498 | VkBool32 drawIndirectFirstInstance |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2499 | VkBool32 depthClamp /// depth clamping |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2500 | VkBool32 depthBiasClamp /// depth bias clamping |
| 2501 | VkBool32 fillModeNonSolid /// point and wireframe fill modes |
| 2502 | VkBool32 depthBounds /// depth bounds test |
| 2503 | VkBool32 wideLines /// lines with width greater than 1 |
| 2504 | VkBool32 largePoints /// points with size greater than 1 |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2505 | VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value |
| 2506 | VkBool32 multiViewport |
| 2507 | VkBool32 samplerAnisotropy |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2508 | VkBool32 textureCompressionETC2 /// ETC texture compression formats |
| 2509 | VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats |
| 2510 | VkBool32 textureCompressionBC /// BC1-7 texture compressed formats |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2511 | VkBool32 occlusionQueryPrecise |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2512 | VkBool32 pipelineStatisticsQuery /// pipeline statistics query |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 2513 | VkBool32 vertexPipelineStoresAndAtomics |
| 2514 | VkBool32 fragmentStoresAndAtomics |
| 2515 | VkBool32 shaderTessellationAndGeometryPointSize |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2516 | VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets |
| 2517 | VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images |
| 2518 | VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 2519 | VkBool32 shaderStorageImageReadWithoutFormat |
| 2520 | VkBool32 shaderStorageImageWriteWithoutFormat |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2521 | VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices |
| 2522 | VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices |
| 2523 | VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices |
| 2524 | VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices |
| 2525 | VkBool32 shaderClipDistance /// clip distance in shaders |
| 2526 | VkBool32 shaderCullDistance /// cull distance in shaders |
| 2527 | VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders |
| 2528 | VkBool32 shaderInt64 /// 64-bit integers in shaders |
| 2529 | VkBool32 shaderInt16 /// 16-bit integers in shaders |
| 2530 | 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] | 2531 | VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2532 | VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level |
| 2533 | VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers |
| 2534 | VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images |
| 2535 | VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images |
| 2536 | VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples |
| 2537 | VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples |
| 2538 | VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples |
| 2539 | VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples |
| 2540 | 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] | 2541 | VkBool32 variableMultisampleRate |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2542 | VkBool32 inheritedQueries |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2543 | } |
| 2544 | |
| 2545 | class VkPhysicalDeviceLimits { |
| 2546 | /// resource maximum sizes |
| 2547 | u32 maxImageDimension1D /// max 1D image dimension |
| 2548 | u32 maxImageDimension2D /// max 2D image dimension |
| 2549 | u32 maxImageDimension3D /// max 3D image dimension |
| 2550 | u32 maxImageDimensionCube /// max cubemap image dimension |
| 2551 | u32 maxImageArrayLayers /// max layers for image arrays |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2552 | u32 maxTexelBufferElements |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2553 | u32 maxUniformBufferRange /// max uniform buffer size (bytes) |
| 2554 | u32 maxStorageBufferRange /// max storage buffer size (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2555 | u32 maxPushConstantsSize /// max size of the push constants pool (bytes) |
| 2556 | /// memory limits |
| 2557 | u32 maxMemoryAllocationCount /// max number of device memory allocations supported |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2558 | u32 maxSamplerAllocationCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2559 | VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage |
| 2560 | VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2561 | /// descriptor set limits |
| 2562 | 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] | 2563 | u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set |
| 2564 | u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set |
| 2565 | u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set |
| 2566 | u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set |
| 2567 | 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] | 2568 | u32 maxPerStageDescriptorInputAttachments |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 2569 | u32 maxPerStageResources |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2570 | u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set |
| 2571 | 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] | 2572 | 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] | 2573 | 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] | 2574 | 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] | 2575 | u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set |
| 2576 | 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] | 2577 | u32 maxDescriptorSetInputAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2578 | /// vertex stage limits |
| 2579 | u32 maxVertexInputAttributes /// max num of vertex input attribute slots |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2580 | u32 maxVertexInputBindings /// max num of vertex input binding slots |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2581 | u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset |
| 2582 | u32 maxVertexInputBindingStride /// max vertex input binding stride |
| 2583 | u32 maxVertexOutputComponents /// max num of output components written by vertex shader |
| 2584 | /// tessellation control stage limits |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2585 | u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2586 | u32 maxTessellationPatchSize /// max patch size (vertices) |
| 2587 | u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS |
| 2588 | u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS |
| 2589 | u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS |
| 2590 | u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS |
| 2591 | u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES |
| 2592 | u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2593 | /// geometry stage limits |
| 2594 | u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader |
| 2595 | u32 maxGeometryInputComponents /// max num of input components read in geometry stage |
| 2596 | u32 maxGeometryOutputComponents /// max num of output components written in geometry stage |
| 2597 | u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage |
| 2598 | u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage |
| 2599 | /// fragment stage limits |
| 2600 | u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2601 | u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2602 | 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] | 2603 | u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers |
| 2604 | /// compute stage limits |
| 2605 | u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes) |
| 2606 | u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z) |
| 2607 | u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group |
| 2608 | u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z) |
| 2609 | |
| 2610 | u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y |
| 2611 | u32 subTexelPrecisionBits /// num bits of subtexel precision |
| 2612 | u32 mipmapPrecisionBits /// num bits of mipmap precision |
| 2613 | |
| 2614 | 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] | 2615 | u32 maxDrawIndirectCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2616 | |
| 2617 | f32 maxSamplerLodBias /// max absolute sampler level of detail bias |
| 2618 | f32 maxSamplerAnisotropy /// max degree of sampler anisotropy |
| 2619 | |
| 2620 | u32 maxViewports /// max number of active viewports |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2621 | u32[2] maxViewportDimensions /// max viewport dimensions (x,y) |
| 2622 | f32[2] viewportBoundsRange /// viewport bounds range (min,max) |
| 2623 | u32 viewportSubPixelBits /// num bits of subpixel precision for viewport |
| 2624 | |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 2625 | platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes) |
| 2626 | VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes) |
| 2627 | VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes) |
| 2628 | VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2629 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2630 | s32 minTexelOffset /// min texel offset for OpTextureSampleOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2631 | u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2632 | s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2633 | u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset |
| 2634 | f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset |
| 2635 | f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset |
| 2636 | u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset |
| 2637 | |
| 2638 | u32 maxFramebufferWidth /// max width for a framebuffer |
| 2639 | u32 maxFramebufferHeight /// max height for a framebuffer |
| 2640 | u32 maxFramebufferLayers /// max layer count for a layered framebuffer |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2641 | VkSampleCountFlags framebufferColorSampleCounts |
| 2642 | VkSampleCountFlags framebufferDepthSampleCounts |
| 2643 | VkSampleCountFlags framebufferStencilSampleCounts |
| 2644 | VkSampleCountFlags framebufferNoAttachmentSampleCounts |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2645 | u32 maxColorAttachments /// max num of framebuffer color attachments |
| 2646 | |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2647 | VkSampleCountFlags sampledImageColorSampleCounts |
| 2648 | VkSampleCountFlags sampledImageIntegerSampleCounts |
| 2649 | VkSampleCountFlags sampledImageDepthSampleCounts |
| 2650 | VkSampleCountFlags sampledImageStencilSampleCounts |
| 2651 | VkSampleCountFlags storageImageSampleCounts |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2652 | u32 maxSampleMaskWords /// max num of sample mask words |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2653 | VkBool32 timestampComputeAndGraphics |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2654 | |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2655 | f32 timestampPeriod |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2656 | |
| 2657 | u32 maxClipDistances /// max number of clip distances |
| 2658 | u32 maxCullDistances /// max number of cull distances |
| 2659 | u32 maxCombinedClipAndCullDistances /// max combined number of user clipping |
| 2660 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2661 | u32 discreteQueuePriorities |
| 2662 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2663 | f32[2] pointSizeRange /// range (min,max) of supported point sizes |
| 2664 | f32[2] lineWidthRange /// range (min,max) of supported line widths |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2665 | f32 pointSizeGranularity /// granularity of supported point sizes |
| 2666 | f32 lineWidthGranularity /// granularity of supported line widths |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2667 | VkBool32 strictLines |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2668 | VkBool32 standardSampleLocations |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2669 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2670 | VkDeviceSize optimalBufferCopyOffsetAlignment |
| 2671 | VkDeviceSize optimalBufferCopyRowPitchAlignment |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 2672 | VkDeviceSize nonCoherentAtomSize |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2673 | } |
| 2674 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2675 | class VkPhysicalDeviceSparseProperties { |
| 2676 | 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] | 2677 | 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] | 2678 | VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format) |
| 2679 | 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] | 2680 | 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 |
| 2681 | } |
| 2682 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2683 | class VkSemaphoreCreateInfo { |
| 2684 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO |
| 2685 | const void* pNext /// Pointer to next structure |
| 2686 | VkSemaphoreCreateFlags flags /// Semaphore creation flags |
| 2687 | } |
| 2688 | |
| 2689 | class VkQueryPoolCreateInfo { |
| 2690 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO |
| 2691 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2692 | VkQueryPoolCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2693 | VkQueryType queryType |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 2694 | u32 queryCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2695 | VkQueryPipelineStatisticFlags pipelineStatistics /// Optional |
| 2696 | } |
| 2697 | |
| 2698 | class VkFramebufferCreateInfo { |
| 2699 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO |
| 2700 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2701 | VkFramebufferCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2702 | VkRenderPass renderPass |
| 2703 | u32 attachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2704 | const VkImageView* pAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2705 | u32 width |
| 2706 | u32 height |
| 2707 | u32 layers |
| 2708 | } |
| 2709 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2710 | class VkDrawIndirectCommand { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2711 | u32 vertexCount |
| 2712 | u32 instanceCount |
| 2713 | u32 firstVertex |
| 2714 | u32 firstInstance |
| 2715 | } |
| 2716 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2717 | class VkDrawIndexedIndirectCommand { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2718 | u32 indexCount |
| 2719 | u32 instanceCount |
| 2720 | u32 firstIndex |
| 2721 | s32 vertexOffset |
| 2722 | u32 firstInstance |
| 2723 | } |
| 2724 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2725 | class VkDispatchIndirectCommand { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2726 | u32 x |
| 2727 | u32 y |
| 2728 | u32 z |
| 2729 | } |
| 2730 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2731 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2732 | class VkSurfaceCapabilitiesKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2733 | u32 minImageCount |
| 2734 | u32 maxImageCount |
| 2735 | VkExtent2D currentExtent |
| 2736 | VkExtent2D minImageExtent |
| 2737 | VkExtent2D maxImageExtent |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2738 | u32 maxImageArrayLayers |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2739 | VkSurfaceTransformFlagsKHR supportedTransforms |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2740 | VkSurfaceTransformFlagBitsKHR currentTransform |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2741 | VkCompositeAlphaFlagsKHR supportedCompositeAlpha |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2742 | VkImageUsageFlags supportedUsageFlags |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2743 | } |
| 2744 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2745 | @extension("VK_KHR_surface") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2746 | class VkSurfaceFormatKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2747 | VkFormat format |
| 2748 | VkColorSpaceKHR colorSpace |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2749 | } |
| 2750 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2751 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2752 | class VkSwapchainCreateInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2753 | VkStructureType sType |
| 2754 | const void* pNext |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2755 | VkSwapchainCreateFlagsKHR flags |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2756 | VkSurfaceKHR surface |
| 2757 | u32 minImageCount |
| 2758 | VkFormat imageFormat |
| 2759 | VkColorSpaceKHR imageColorSpace |
| 2760 | VkExtent2D imageExtent |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2761 | u32 imageArrayLayers |
| 2762 | VkImageUsageFlags imageUsage |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2763 | VkSharingMode sharingMode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2764 | u32 queueFamilyIndexCount |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2765 | const u32* pQueueFamilyIndices |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2766 | VkSurfaceTransformFlagBitsKHR preTransform |
| 2767 | VkCompositeAlphaFlagBitsKHR compositeAlpha |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2768 | VkPresentModeKHR presentMode |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2769 | VkBool32 clipped |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2770 | VkSwapchainKHR oldSwapchain |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2771 | } |
| 2772 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2773 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2774 | class VkPresentInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2775 | VkStructureType sType |
| 2776 | const void* pNext |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2777 | u32 waitSemaphoreCount |
| 2778 | const VkSemaphore* pWaitSemaphores |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2779 | u32 swapchainCount |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2780 | const VkSwapchainKHR* pSwapchains |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2781 | const u32* pImageIndices |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 2782 | VkResult* pResults |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2783 | } |
| 2784 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2785 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2786 | class VkDisplayPropertiesKHR { |
| 2787 | VkDisplayKHR display |
| 2788 | const char* displayName |
| 2789 | VkExtent2D physicalDimensions |
| 2790 | VkExtent2D physicalResolution |
| 2791 | VkSurfaceTransformFlagsKHR supportedTransforms |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2792 | VkBool32 planeReorderPossible |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2793 | VkBool32 persistentContent |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2794 | } |
| 2795 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2796 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2797 | class VkDisplayModeParametersKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2798 | VkExtent2D visibleRegion |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2799 | u32 refreshRate |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2800 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2801 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2802 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2803 | class VkDisplayModePropertiesKHR { |
| 2804 | VkDisplayModeKHR displayMode |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2805 | VkDisplayModeParametersKHR parameters |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2806 | } |
| 2807 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2808 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2809 | class VkDisplayModeCreateInfoKHR { |
| 2810 | VkStructureType sType |
| 2811 | const void* pNext |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 2812 | VkDisplayModeCreateFlagsKHR flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2813 | VkDisplayModeParametersKHR parameters |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2814 | } |
| 2815 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2816 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2817 | class VkDisplayPlanePropertiesKHR { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2818 | VkDisplayKHR currentDisplay |
| 2819 | u32 currentStackIndex |
| 2820 | } |
| 2821 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2822 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2823 | class VkDisplayPlaneCapabilitiesKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2824 | VkDisplayPlaneAlphaFlagsKHR supportedAlpha |
| 2825 | VkOffset2D minSrcPosition |
| 2826 | VkOffset2D maxSrcPosition |
| 2827 | VkExtent2D minSrcExtent |
| 2828 | VkExtent2D maxSrcExtent |
| 2829 | VkOffset2D minDstPosition |
| 2830 | VkOffset2D maxDstPosition |
| 2831 | VkExtent2D minDstExtent |
| 2832 | VkExtent2D maxDstExtent |
| 2833 | } |
| 2834 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2835 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2836 | class VkDisplaySurfaceCreateInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2837 | VkStructureType sType |
| 2838 | const void* pNext |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2839 | VkDisplaySurfaceCreateFlagsKHR flags |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2840 | VkDisplayModeKHR displayMode |
| 2841 | u32 planeIndex |
| 2842 | u32 planeStackIndex |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2843 | VkSurfaceTransformFlagBitsKHR transform |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2844 | f32 globalAlpha |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2845 | VkDisplayPlaneAlphaFlagBitsKHR alphaMode |
| 2846 | VkExtent2D imageExtent |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2847 | } |
| 2848 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2849 | @extension("VK_KHR_display_swapchain") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2850 | class VkDisplayPresentInfoKHR { |
| 2851 | VkStructureType sType |
| 2852 | const void* pNext |
| 2853 | VkRect2D srcRect |
| 2854 | VkRect2D dstRect |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2855 | VkBool32 persistent |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2856 | } |
| 2857 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2858 | @extension("VK_KHR_xlib_surface") |
| 2859 | class VkXlibSurfaceCreateInfoKHR { |
| 2860 | VkStructureType sType |
| 2861 | const void* pNext |
| 2862 | VkXlibSurfaceCreateFlagsKHR flags |
| 2863 | platform.Display* dpy |
| 2864 | platform.Window window |
| 2865 | } |
| 2866 | |
| 2867 | @extension("VK_KHR_xcb_surface") |
| 2868 | class VkXcbSurfaceCreateInfoKHR { |
| 2869 | VkStructureType sType |
| 2870 | const void* pNext |
| 2871 | VkXcbSurfaceCreateFlagsKHR flags |
| 2872 | platform.xcb_connection_t* connection |
| 2873 | platform.xcb_window_t window |
| 2874 | } |
| 2875 | |
| 2876 | @extension("VK_KHR_wayland_surface") |
| 2877 | class VkWaylandSurfaceCreateInfoKHR { |
| 2878 | VkStructureType sType |
| 2879 | const void* pNext |
| 2880 | VkWaylandSurfaceCreateFlagsKHR flags |
| 2881 | platform.wl_display* display |
| 2882 | platform.wl_surface* surface |
| 2883 | } |
| 2884 | |
| 2885 | @extension("VK_KHR_mir_surface") |
| 2886 | class VkMirSurfaceCreateInfoKHR { |
| 2887 | VkStructureType sType |
| 2888 | const void* pNext |
| 2889 | VkMirSurfaceCreateFlagsKHR flags |
| 2890 | platform.MirConnection* connection |
| 2891 | platform.MirSurface* mirSurface |
| 2892 | } |
| 2893 | |
| 2894 | @extension("VK_KHR_android_surface") |
| 2895 | class VkAndroidSurfaceCreateInfoKHR { |
| 2896 | VkStructureType sType |
| 2897 | const void* pNext |
| 2898 | VkAndroidSurfaceCreateFlagsKHR flags |
| 2899 | platform.ANativeWindow* window |
| 2900 | } |
| 2901 | |
| 2902 | @extension("VK_KHR_win32_surface") |
| 2903 | class VkWin32SurfaceCreateInfoKHR { |
| 2904 | VkStructureType sType |
| 2905 | const void* pNext |
| 2906 | VkWin32SurfaceCreateFlagsKHR flags |
| 2907 | platform.HINSTANCE hinstance |
| 2908 | platform.HWND hwnd |
| 2909 | } |
| 2910 | |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 2911 | @extension("VK_ANDROID_native_buffer") |
| 2912 | class VkNativeBufferANDROID { |
| 2913 | VkStructureType sType |
| 2914 | const void* pNext |
| 2915 | platform.buffer_handle_t handle |
| 2916 | int stride |
| 2917 | int format |
| 2918 | int usage |
| 2919 | } |
| 2920 | |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 2921 | @extension("VK_ANDROID_native_buffer") |
| 2922 | class VkSwapchainImageCreateInfoANDROID { |
| 2923 | VkStructureType sType |
| 2924 | const void* pNext |
Chris Forbes | 134d958 | 2017-01-12 14:26:37 +1300 | [diff] [blame] | 2925 | VkSwapchainImageUsageFlagsANDROID flags |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 2926 | } |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 2927 | |
| 2928 | @extension("VK_GOOGLE_display_timing") |
| 2929 | class VkRefreshCycleDurationGOOGLE { |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 2930 | u64 minRefreshDuration |
| 2931 | u64 maxRefreshDuration |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 2932 | } |
| 2933 | |
| 2934 | @extension("VK_GOOGLE_display_timing") |
| 2935 | class VkPastPresentationTimingGOOGLE { |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 2936 | u32 presentID |
| 2937 | u64 desiredPresentTime |
| 2938 | u64 actualPresentTime |
| 2939 | u64 earliestPresentTime |
| 2940 | u64 presentMargin |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 2941 | } |
| 2942 | |
| 2943 | @extension("VK_GOOGLE_display_timing") |
| 2944 | class VkPresentTimeGOOGLE { |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 2945 | u32 presentID |
| 2946 | u64 desiredPresentTime |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 2947 | } |
| 2948 | |
| 2949 | @extension("VK_GOOGLE_display_timing") |
| 2950 | class VkPresentTimesInfoGOOGLE { |
| 2951 | VkStructureType sType |
| 2952 | const void* pNext |
Chris Forbes | 4885371 | 2017-01-12 14:09:33 +1300 | [diff] [blame] | 2953 | u32 swapchainCount |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 2954 | const VkPresentTimeGOOGLE* pTimes |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 2955 | } |
| 2956 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 2957 | @extension("VK_EXT_debug_report") |
| 2958 | class VkDebugReportCallbackCreateInfoEXT { |
| 2959 | VkStructureType sType |
| 2960 | const void* pNext |
| 2961 | VkDebugReportFlagsEXT flags |
| 2962 | PFN_vkDebugReportCallbackEXT pfnCallback |
| 2963 | void* pUserData |
| 2964 | } |
| 2965 | |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 2966 | @extension("VK_AMD_rasterization_order") |
| 2967 | class VkPipelineRasterizationStateRasterizationOrderAMD { |
| 2968 | VkStructureType sType |
| 2969 | const void* pNext |
| 2970 | VkRasterizationOrderAMD rasterizationOrder |
| 2971 | } |
| 2972 | |
| 2973 | @extension("VK_EXT_debug_marker") |
| 2974 | class VkDebugMarkerObjectNameInfoEXT { |
| 2975 | VkStructureType sType |
| 2976 | const void* pNext |
| 2977 | VkDebugReportObjectTypeEXT objectType |
| 2978 | u64 object |
| 2979 | const char* pObjectName |
| 2980 | } |
| 2981 | |
| 2982 | @extension("VK_EXT_debug_marker") |
| 2983 | class VkDebugMarkerObjectTagInfoEXT { |
| 2984 | VkStructureType sType |
| 2985 | const void* pNext |
| 2986 | VkDebugReportObjectTypeEXT objectType |
| 2987 | u64 object |
| 2988 | u64 tagName |
| 2989 | platform.size_t tagSize |
| 2990 | const void* pTag |
| 2991 | } |
| 2992 | |
| 2993 | @extension("VK_EXT_debug_marker") |
| 2994 | class VkDebugMarkerMarkerInfoEXT { |
| 2995 | VkStructureType sType |
| 2996 | const void* pNext |
| 2997 | const char* pMarkerName |
| 2998 | f32[4] color |
| 2999 | } |
| 3000 | |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 3001 | @extension("VK_NV_dedicated_allocation") |
| 3002 | class VkDedicatedAllocationImageCreateInfoNV { |
| 3003 | VkStructureType sType |
| 3004 | const void* pNext |
| 3005 | VkBool32 dedicatedAllocation |
| 3006 | } |
| 3007 | |
| 3008 | @extension("VK_NV_dedicated_allocation") |
| 3009 | class VkDedicatedAllocationBufferCreateInfoNV { |
| 3010 | VkStructureType sType |
| 3011 | const void* pNext |
| 3012 | VkBool32 dedicatedAllocation |
| 3013 | } |
| 3014 | |
| 3015 | @extension("VK_NV_dedicated_allocation") |
| 3016 | class VkDedicatedAllocationMemoryAllocateInfoNV { |
| 3017 | VkStructureType sType |
| 3018 | const void* pNext |
| 3019 | VkImage image |
| 3020 | VkBuffer buffer |
| 3021 | } |
| 3022 | |
Chris Forbes | 1194ede | 2016-12-30 16:29:25 +1300 | [diff] [blame] | 3023 | @extension("VK_KHR_get_physical_device_properties2") |
| 3024 | class VkPhysicalDeviceFeatures2KHR { |
| 3025 | VkStructureType sType |
| 3026 | void* pNext |
| 3027 | VkPhysicalDeviceFeatures features |
| 3028 | } |
| 3029 | |
| 3030 | @extension("VK_KHR_get_physical_device_properties2") |
| 3031 | class VkPhysicalDeviceProperties2KHR { |
| 3032 | VkStructureType sType |
| 3033 | void* pNext |
| 3034 | VkPhysicalDeviceProperties properties |
| 3035 | } |
| 3036 | |
| 3037 | @extension("VK_KHR_get_physical_device_properties2") |
| 3038 | class VkFormatProperties2KHR { |
| 3039 | VkStructureType sType |
| 3040 | void* pNext |
| 3041 | VkFormatProperties formatProperties |
| 3042 | } |
| 3043 | |
| 3044 | @extension("VK_KHR_get_physical_device_properties2") |
| 3045 | class VkImageFormatProperties2KHR { |
| 3046 | VkStructureType sType |
| 3047 | void* pNext |
| 3048 | VkImageFormatProperties imageFormatProperties |
| 3049 | } |
| 3050 | |
| 3051 | @extension("VK_KHR_get_physical_device_properties2") |
| 3052 | class VkPhysicalDeviceImageFormatInfo2KHR { |
| 3053 | VkStructureType sType |
| 3054 | const void* pNext |
| 3055 | VkFormat format |
| 3056 | VkImageType type |
| 3057 | VkImageTiling tiling |
| 3058 | VkImageUsageFlags usage |
| 3059 | VkImageCreateFlags flags |
| 3060 | } |
| 3061 | |
| 3062 | @extension("VK_KHR_get_physical_device_properties2") |
| 3063 | class VkQueueFamilyProperties2KHR { |
| 3064 | VkStructureType sType |
| 3065 | void* pNext |
| 3066 | VkQueueFamilyProperties queueFamilyProperties |
| 3067 | } |
| 3068 | |
| 3069 | @extension("VK_KHR_get_physical_device_properties2") |
| 3070 | class VkPhysicalDeviceMemoryProperties2KHR { |
| 3071 | VkStructureType sType |
| 3072 | void* pNext |
| 3073 | VkPhysicalDeviceMemoryProperties memoryProperties |
| 3074 | } |
| 3075 | |
| 3076 | @extension("VK_KHR_get_physical_device_properties2") |
| 3077 | class VkSparseImageFormatProperties2KHR { |
| 3078 | VkStructureType sType |
| 3079 | void* pNext |
| 3080 | VkSparseImageFormatProperties properties |
| 3081 | } |
| 3082 | |
| 3083 | @extension("VK_KHR_get_physical_device_properties2") |
| 3084 | class VkPhysicalDeviceSparseImageFormatInfo2KHR { |
| 3085 | VkStructureType sType |
| 3086 | const void* pNext |
| 3087 | VkFormat format |
| 3088 | VkImageType type |
| 3089 | VkSampleCountFlagBits samples |
| 3090 | VkImageUsageFlags usage |
| 3091 | VkImageTiling tiling |
| 3092 | } |
| 3093 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 3094 | @extension("VK_KHR_incremental_present") |
| 3095 | class VkRectLayerKHR { |
| 3096 | VkOffset2D offset |
| 3097 | VkExtent2D extent |
| 3098 | u32 layer |
| 3099 | } |
| 3100 | |
| 3101 | @extension("VK_KHR_incremental_present") |
| 3102 | class VkPresentRegionKHR { |
| 3103 | u32 rectangleCount |
| 3104 | const VkRectLayerKHR* pRectangles |
| 3105 | } |
| 3106 | |
| 3107 | @extension("VK_KHR_incremental_present") |
| 3108 | class VkPresentRegionsKHR { |
| 3109 | VkStructureType sType |
| 3110 | const void* pNext |
| 3111 | u32 swapchainCount |
| 3112 | const VkPresentRegionKHR* pRegions |
| 3113 | } |
| 3114 | |
| 3115 | @extension("VK_NV_external_memory_capabilities") |
| 3116 | class VkExternalImageFormatPropertiesNV { |
| 3117 | VkImageFormatProperties imageFormatProperties |
| 3118 | VkExternalMemoryFeatureFlagsNV externalMemoryFeatures |
| 3119 | VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes |
| 3120 | VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes |
| 3121 | } |
| 3122 | |
| 3123 | @extension("VK_NV_external_memory") |
| 3124 | class VkExternalMemoryImageCreateInfoNV { |
| 3125 | VkStructureType sType |
| 3126 | const void* pNext |
| 3127 | VkExternalMemoryHandleTypeFlagsNV handleTypes |
| 3128 | } |
| 3129 | |
| 3130 | @extension("VK_NV_external_memory") |
| 3131 | class VkExportMemoryAllocateInfoNV { |
| 3132 | VkStructureType sType |
| 3133 | const void* pNext |
| 3134 | VkExternalMemoryHandleTypeFlagsNV handleTypes |
| 3135 | } |
| 3136 | |
| 3137 | @extension("VK_NV_external_memory_win32") |
| 3138 | class VkImportMemoryWin32HandleInfoNV { |
| 3139 | VkStructureType sType |
| 3140 | const void* pNext |
| 3141 | VkExternalMemoryHandleTypeFlagsNV handleType |
| 3142 | platform.HANDLE handle |
| 3143 | } |
| 3144 | |
| 3145 | @extension("VK_NV_external_memory_win32") |
| 3146 | class VkExportMemoryWin32HandleInfoNV { |
| 3147 | VkStructureType sType |
| 3148 | const void* pNext |
| 3149 | const platform.SECURITY_ATTRIBUTES* pAttributes |
| 3150 | u32 dwAccess |
| 3151 | } |
| 3152 | |
| 3153 | @extension("VK_NV_win32_keyed_mutex") |
| 3154 | class VkWin32KeyedMutexAcquireReleaseInfoNV { |
| 3155 | VkStructureType sType |
| 3156 | const void* pNext |
| 3157 | u32 acquireCount |
| 3158 | const VkDeviceMemory* pAcquireSyncs |
| 3159 | const u64* pAcquireKeys |
| 3160 | const u32* pAcquireTimeoutMilliseconds |
| 3161 | u32 releaseCount |
| 3162 | const VkDeviceMemory* pReleaseSyncs |
| 3163 | const u64* pReleaseKeys |
| 3164 | } |
| 3165 | |
| 3166 | @extension("VK_EXT_validation_flags") |
| 3167 | class VkValidationFlagsEXT { |
| 3168 | VkStructureType sType |
| 3169 | const void* pNext |
| 3170 | u32 disabledValidationCheckCount |
| 3171 | VkValidationCheckEXT* pDisabledValidationChecks |
| 3172 | } |
| 3173 | |
| 3174 | @extension("VK_NVX_device_generated_commands") |
| 3175 | class VkDeviceGeneratedCommandsFeaturesNVX { |
| 3176 | VkStructureType sType |
| 3177 | const void* pNext |
| 3178 | VkBool32 computeBindingPointSupport |
| 3179 | } |
| 3180 | |
| 3181 | @extension("VK_NVX_device_generated_commands") |
| 3182 | class VkDeviceGeneratedCommandsLimitsNVX { |
| 3183 | VkStructureType sType |
| 3184 | const void* pNext |
| 3185 | u32 maxIndirectCommandsLayoutTokenCount |
| 3186 | u32 maxObjectEntryCounts |
| 3187 | u32 minSequenceCountBufferOffsetAlignment |
| 3188 | u32 minSequenceIndexBufferOffsetAlignment |
| 3189 | u32 minCommandsTokenBufferOffsetAlignment |
| 3190 | } |
| 3191 | |
| 3192 | @extension("VK_NVX_device_generated_commands") |
| 3193 | class VkIndirectCommandsTokenNVX { |
| 3194 | VkIndirectCommandsTokenTypeNVX tokenType |
| 3195 | VkBuffer buffer |
| 3196 | VkDeviceSize offset |
| 3197 | } |
| 3198 | |
| 3199 | @extension("VK_NVX_device_generated_commands") |
| 3200 | class VkIndirectCommandsLayoutTokenNVX { |
| 3201 | VkIndirectCommandsTokenTypeNVX tokenType |
| 3202 | u32 bindingUnit |
| 3203 | u32 dynamicCount |
| 3204 | u32 divisor |
| 3205 | } |
| 3206 | |
| 3207 | @extension("VK_NVX_device_generated_commands") |
| 3208 | class VkIndirectCommandsLayoutCreateInfoNVX { |
| 3209 | VkStructureType sType |
| 3210 | const void* pNext |
| 3211 | VkPipelineBindPoint pipelineBindPoint |
| 3212 | VkIndirectCommandsLayoutUsageFlagsNVX flags |
| 3213 | u32 tokenCount |
| 3214 | const VkIndirectCommandsLayoutTokenNVX* pTokens |
| 3215 | } |
| 3216 | |
| 3217 | @extension("VK_NVX_device_generated_commands") |
| 3218 | class VkCmdProcessCommandsInfoNVX { |
| 3219 | VkStructureType sType |
| 3220 | const void* pNext |
| 3221 | VkObjectTableNVX objectTable |
| 3222 | VkIndirectCommandsLayoutNVX indirectCommandsLayout |
| 3223 | u32 indirectCommandsTokenCount |
| 3224 | const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens |
| 3225 | u32 maxSequencesCount |
| 3226 | VkCommandBuffer targetCommandBuffer |
| 3227 | VkBuffer sequencesCountBuffer |
| 3228 | VkDeviceSize sequencesCountOffset |
| 3229 | VkBuffer sequencesIndexBuffer |
| 3230 | VkDeviceSize sequencesIndexOffset |
| 3231 | } |
| 3232 | |
| 3233 | @extension("VK_NVX_device_generated_commands") |
| 3234 | class VkCmdReserveSpaceForCommandsInfoNVX { |
| 3235 | VkStructureType sType |
| 3236 | const void* pNext |
| 3237 | VkObjectTableNVX objectTable |
| 3238 | VkIndirectCommandsLayoutNVX indirectCommandsLayout |
| 3239 | u32 maxSequencesCount |
| 3240 | } |
| 3241 | |
| 3242 | @extension("VK_NVX_device_generated_commands") |
| 3243 | class VkObjectTableCreateInfoNVX { |
| 3244 | VkStructureType sType |
| 3245 | const void* pNext |
| 3246 | u32 objectCount |
| 3247 | const VkObjectEntryTypeNVX* pObjectEntryTypes |
| 3248 | const u32* pObjectEntryCounts |
| 3249 | const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags |
| 3250 | u32 maxUniformBuffersPerDescriptor |
| 3251 | u32 maxStorageBuffersPerDescriptor |
| 3252 | u32 maxStorageImagesPerDescriptor |
| 3253 | u32 maxSampledImagesPerDescriptor |
| 3254 | u32 maxPipelineLayouts |
| 3255 | } |
| 3256 | |
| 3257 | @extension("VK_NVX_device_generated_commands") |
| 3258 | class VkObjectTableEntryNVX { |
| 3259 | VkObjectEntryTypeNVX type |
| 3260 | VkObjectEntryUsageFlagsNVX flags |
| 3261 | } |
| 3262 | |
| 3263 | @extension("VK_NVX_device_generated_commands") |
| 3264 | class VkObjectTablePipelineEntryNVX { |
| 3265 | VkObjectEntryTypeNVX type |
| 3266 | VkObjectEntryUsageFlagsNVX flags |
| 3267 | VkPipeline pipeline |
| 3268 | } |
| 3269 | |
| 3270 | @extension("VK_NVX_device_generated_commands") |
| 3271 | class VkObjectTableDescriptorSetEntryNVX { |
| 3272 | VkObjectEntryTypeNVX type |
| 3273 | VkObjectEntryUsageFlagsNVX flags |
| 3274 | VkPipelineLayout pipelineLayout |
| 3275 | VkDescriptorSet descriptorSet |
| 3276 | } |
| 3277 | |
| 3278 | @extension("VK_NVX_device_generated_commands") |
| 3279 | class VkObjectTableVertexBufferEntryNVX { |
| 3280 | VkObjectEntryTypeNVX type |
| 3281 | VkObjectEntryUsageFlagsNVX flags |
| 3282 | VkBuffer buffer |
| 3283 | } |
| 3284 | |
| 3285 | @extension("VK_NVX_device_generated_commands") |
| 3286 | class VkObjectTableIndexBufferEntryNVX { |
| 3287 | VkObjectEntryTypeNVX type |
| 3288 | VkObjectEntryUsageFlagsNVX flags |
| 3289 | VkBuffer buffer |
| 3290 | } |
| 3291 | |
| 3292 | @extension("VK_NVX_device_generated_commands") |
| 3293 | class VkObjectTablePushConstantEntryNVX { |
| 3294 | VkObjectEntryTypeNVX type |
| 3295 | VkObjectEntryUsageFlagsNVX flags |
| 3296 | VkPipelineLayout pipelineLayout |
| 3297 | VkShaderStageFlags stageFlags |
| 3298 | } |
| 3299 | |
| 3300 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 3301 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3302 | //////////////// |
| 3303 | // Commands // |
| 3304 | //////////////// |
| 3305 | |
| 3306 | // Function pointers. TODO: add support for function pointers. |
| 3307 | |
| 3308 | @external type void* PFN_vkVoidFunction |
| 3309 | @pfn cmd void vkVoidFunction() { |
| 3310 | } |
| 3311 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3312 | @external type void* PFN_vkAllocationFunction |
| 3313 | @pfn cmd void* vkAllocationFunction( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3314 | void* pUserData, |
| 3315 | platform.size_t size, |
| 3316 | platform.size_t alignment, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3317 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3318 | return ? |
| 3319 | } |
| 3320 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3321 | @external type void* PFN_vkReallocationFunction |
| 3322 | @pfn cmd void* vkReallocationFunction( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3323 | void* pUserData, |
| 3324 | void* pOriginal, |
| 3325 | platform.size_t size, |
| 3326 | platform.size_t alignment, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3327 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3328 | return ? |
| 3329 | } |
| 3330 | |
| 3331 | @external type void* PFN_vkFreeFunction |
| 3332 | @pfn cmd void vkFreeFunction( |
| 3333 | void* pUserData, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3334 | void* pMemory) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3335 | } |
| 3336 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3337 | @external type void* PFN_vkInternalAllocationNotification |
| 3338 | @pfn cmd void vkInternalAllocationNotification( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3339 | void* pUserData, |
| 3340 | platform.size_t size, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3341 | VkInternalAllocationType allocationType, |
| 3342 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3343 | } |
| 3344 | |
| 3345 | @external type void* PFN_vkInternalFreeNotification |
| 3346 | @pfn cmd void vkInternalFreeNotification( |
| 3347 | void* pUserData, |
| 3348 | platform.size_t size, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3349 | VkInternalAllocationType allocationType, |
| 3350 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3351 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3352 | |
| 3353 | // Global functions |
| 3354 | |
| 3355 | @threadSafety("system") |
| 3356 | cmd VkResult vkCreateInstance( |
| 3357 | const VkInstanceCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3358 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3359 | VkInstance* pInstance) { |
| 3360 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO) |
| 3361 | |
| 3362 | instance := ? |
| 3363 | pInstance[0] = instance |
| 3364 | State.Instances[instance] = new!InstanceObject() |
| 3365 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 3366 | layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount] |
| 3367 | extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3368 | |
| 3369 | return ? |
| 3370 | } |
| 3371 | |
| 3372 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3373 | cmd void vkDestroyInstance( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3374 | VkInstance instance, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3375 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3376 | instanceObject := GetInstance(instance) |
| 3377 | |
| 3378 | State.Instances[instance] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3379 | } |
| 3380 | |
| 3381 | @threadSafety("system") |
| 3382 | cmd VkResult vkEnumeratePhysicalDevices( |
| 3383 | VkInstance instance, |
| 3384 | u32* pPhysicalDeviceCount, |
| 3385 | VkPhysicalDevice* pPhysicalDevices) { |
| 3386 | instanceObject := GetInstance(instance) |
| 3387 | |
| 3388 | physicalDeviceCount := as!u32(?) |
| 3389 | pPhysicalDeviceCount[0] = physicalDeviceCount |
| 3390 | physicalDevices := pPhysicalDevices[0:physicalDeviceCount] |
| 3391 | |
| 3392 | for i in (0 .. physicalDeviceCount) { |
| 3393 | physicalDevice := ? |
| 3394 | physicalDevices[i] = physicalDevice |
| 3395 | if !(physicalDevice in State.PhysicalDevices) { |
| 3396 | State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance) |
| 3397 | } |
| 3398 | } |
| 3399 | |
| 3400 | return ? |
| 3401 | } |
| 3402 | |
| 3403 | cmd PFN_vkVoidFunction vkGetDeviceProcAddr( |
| 3404 | VkDevice device, |
| 3405 | const char* pName) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3406 | if device != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3407 | device := GetDevice(device) |
| 3408 | } |
| 3409 | |
| 3410 | return ? |
| 3411 | } |
| 3412 | |
| 3413 | cmd PFN_vkVoidFunction vkGetInstanceProcAddr( |
| 3414 | VkInstance instance, |
| 3415 | const char* pName) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3416 | if instance != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3417 | instanceObject := GetInstance(instance) |
| 3418 | } |
| 3419 | |
| 3420 | return ? |
| 3421 | } |
| 3422 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3423 | cmd void vkGetPhysicalDeviceProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3424 | VkPhysicalDevice physicalDevice, |
| 3425 | VkPhysicalDeviceProperties* pProperties) { |
| 3426 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3427 | |
| 3428 | properties := ? |
| 3429 | pProperties[0] = properties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3430 | } |
| 3431 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3432 | cmd void vkGetPhysicalDeviceQueueFamilyProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3433 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3434 | u32* pQueueFamilyPropertyCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3435 | VkQueueFamilyProperties* pQueueFamilyProperties) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3436 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3437 | // TODO: Figure out how to express fetch-count-or-properties |
| 3438 | // This version fails 'apic validate' with 'fence not allowed in |
| 3439 | // *semantic.Branch'. Other attempts have failed with the same or other |
| 3440 | // errors. |
| 3441 | // if pQueueFamilyProperties != null { |
| 3442 | // queuesProperties := pQueueFamilyProperties[0:pCount[0]] |
| 3443 | // for i in (0 .. pCount[0]) { |
| 3444 | // queueProperties := as!VkQueueFamilyProperties(?) |
| 3445 | // queuesProperties[i] = queueProperties |
| 3446 | // } |
| 3447 | // } else { |
| 3448 | // count := ? |
| 3449 | // pCount[0] = count |
| 3450 | // } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3451 | } |
| 3452 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3453 | cmd void vkGetPhysicalDeviceMemoryProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3454 | VkPhysicalDevice physicalDevice, |
| 3455 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) { |
| 3456 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3457 | |
| 3458 | memoryProperties := ? |
| 3459 | pMemoryProperties[0] = memoryProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3460 | } |
| 3461 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3462 | cmd void vkGetPhysicalDeviceFeatures( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3463 | VkPhysicalDevice physicalDevice, |
| 3464 | VkPhysicalDeviceFeatures* pFeatures) { |
| 3465 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3466 | |
| 3467 | features := ? |
| 3468 | pFeatures[0] = features |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3469 | } |
| 3470 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3471 | cmd void vkGetPhysicalDeviceFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3472 | VkPhysicalDevice physicalDevice, |
| 3473 | VkFormat format, |
| 3474 | VkFormatProperties* pFormatProperties) { |
| 3475 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3476 | |
| 3477 | formatProperties := ? |
| 3478 | pFormatProperties[0] = formatProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3479 | } |
| 3480 | |
Jesse Hall | a9e5703 | 2015-11-30 01:03:10 -0800 | [diff] [blame] | 3481 | cmd VkResult vkGetPhysicalDeviceImageFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3482 | VkPhysicalDevice physicalDevice, |
| 3483 | VkFormat format, |
| 3484 | VkImageType type, |
| 3485 | VkImageTiling tiling, |
| 3486 | VkImageUsageFlags usage, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3487 | VkImageCreateFlags flags, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3488 | VkImageFormatProperties* pImageFormatProperties) { |
| 3489 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3490 | |
| 3491 | imageFormatProperties := ? |
| 3492 | pImageFormatProperties[0] = imageFormatProperties |
Jesse Hall | a9e5703 | 2015-11-30 01:03:10 -0800 | [diff] [blame] | 3493 | |
| 3494 | return ? |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3495 | } |
| 3496 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3497 | |
| 3498 | // Device functions |
| 3499 | |
| 3500 | @threadSafety("system") |
| 3501 | cmd VkResult vkCreateDevice( |
| 3502 | VkPhysicalDevice physicalDevice, |
| 3503 | const VkDeviceCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3504 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3505 | VkDevice* pDevice) { |
| 3506 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO) |
| 3507 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3508 | |
| 3509 | device := ? |
| 3510 | pDevice[0] = device |
| 3511 | State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice) |
| 3512 | |
| 3513 | return ? |
| 3514 | } |
| 3515 | |
| 3516 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3517 | cmd void vkDestroyDevice( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3518 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3519 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3520 | deviceObject := GetDevice(device) |
| 3521 | |
| 3522 | State.Devices[device] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3523 | } |
| 3524 | |
| 3525 | |
| 3526 | // Extension discovery functions |
| 3527 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3528 | cmd VkResult vkEnumerateInstanceLayerProperties( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3529 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3530 | VkLayerProperties* pProperties) { |
| 3531 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3532 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3533 | |
| 3534 | properties := pProperties[0:count] |
| 3535 | for i in (0 .. count) { |
| 3536 | property := ? |
| 3537 | properties[i] = property |
| 3538 | } |
| 3539 | |
| 3540 | return ? |
| 3541 | } |
| 3542 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3543 | cmd VkResult vkEnumerateInstanceExtensionProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3544 | const char* pLayerName, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3545 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3546 | VkExtensionProperties* pProperties) { |
| 3547 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3548 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3549 | |
| 3550 | properties := pProperties[0:count] |
| 3551 | for i in (0 .. count) { |
| 3552 | property := ? |
| 3553 | properties[i] = property |
| 3554 | } |
| 3555 | |
| 3556 | return ? |
| 3557 | } |
| 3558 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3559 | cmd VkResult vkEnumerateDeviceLayerProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3560 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3561 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3562 | VkLayerProperties* pProperties) { |
| 3563 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3564 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3565 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3566 | |
| 3567 | properties := pProperties[0:count] |
| 3568 | for i in (0 .. count) { |
| 3569 | property := ? |
| 3570 | properties[i] = property |
| 3571 | } |
| 3572 | |
| 3573 | return ? |
| 3574 | } |
| 3575 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3576 | cmd VkResult vkEnumerateDeviceExtensionProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3577 | VkPhysicalDevice physicalDevice, |
| 3578 | const char* pLayerName, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3579 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3580 | VkExtensionProperties* pProperties) { |
| 3581 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 3582 | |
| 3583 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3584 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3585 | |
| 3586 | properties := pProperties[0:count] |
| 3587 | for i in (0 .. count) { |
| 3588 | property := ? |
| 3589 | properties[i] = property |
| 3590 | } |
| 3591 | |
| 3592 | return ? |
| 3593 | } |
| 3594 | |
| 3595 | |
| 3596 | // Queue functions |
| 3597 | |
| 3598 | @threadSafety("system") |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3599 | cmd void vkGetDeviceQueue( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3600 | VkDevice device, |
| 3601 | u32 queueFamilyIndex, |
| 3602 | u32 queueIndex, |
| 3603 | VkQueue* pQueue) { |
| 3604 | deviceObject := GetDevice(device) |
| 3605 | |
| 3606 | queue := ? |
| 3607 | pQueue[0] = queue |
| 3608 | |
| 3609 | if !(queue in State.Queues) { |
| 3610 | State.Queues[queue] = new!QueueObject(device: device) |
| 3611 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3612 | } |
| 3613 | |
| 3614 | @threadSafety("app") |
| 3615 | cmd VkResult vkQueueSubmit( |
| 3616 | VkQueue queue, |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 3617 | u32 submitCount, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 3618 | const VkSubmitInfo* pSubmits, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3619 | VkFence fence) { |
| 3620 | queueObject := GetQueue(queue) |
| 3621 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3622 | if fence != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3623 | fenceObject := GetFence(fence) |
| 3624 | assert(fenceObject.device == queueObject.device) |
| 3625 | } |
| 3626 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3627 | // commandBuffers := pcommandBuffers[0:commandBufferCount] |
| 3628 | // for i in (0 .. commandBufferCount) { |
| 3629 | // commandBuffer := commandBuffers[i] |
| 3630 | // commandBufferObject := GetCommandBuffer(commandBuffer) |
| 3631 | // assert(commandBufferObject.device == queueObject.device) |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 3632 | // |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3633 | // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags, |
| 3634 | // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.") |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 3635 | // } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3636 | |
| 3637 | return ? |
| 3638 | } |
| 3639 | |
| 3640 | @threadSafety("system") |
| 3641 | cmd VkResult vkQueueWaitIdle( |
| 3642 | VkQueue queue) { |
| 3643 | queueObject := GetQueue(queue) |
| 3644 | |
| 3645 | return ? |
| 3646 | } |
| 3647 | |
| 3648 | @threadSafety("system") |
| 3649 | cmd VkResult vkDeviceWaitIdle( |
| 3650 | VkDevice device) { |
| 3651 | deviceObject := GetDevice(device) |
| 3652 | |
| 3653 | return ? |
| 3654 | } |
| 3655 | |
| 3656 | |
| 3657 | // Memory functions |
| 3658 | |
| 3659 | @threadSafety("system") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3660 | cmd VkResult vkAllocateMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3661 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3662 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 3663 | const VkAllocationCallbacks* pAllocator, |
| 3664 | VkDeviceMemory* pMemory) { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 3665 | assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3666 | deviceObject := GetDevice(device) |
| 3667 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3668 | memory := ? |
| 3669 | pMemory[0] = memory |
| 3670 | State.DeviceMemories[memory] = new!DeviceMemoryObject( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3671 | device: device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3672 | allocationSize: pAllocateInfo[0].allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3673 | |
| 3674 | return ? |
| 3675 | } |
| 3676 | |
| 3677 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3678 | cmd void vkFreeMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3679 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3680 | VkDeviceMemory memory, |
| 3681 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3682 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3683 | memoryObject := GetDeviceMemory(memory) |
| 3684 | assert(memoryObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3685 | |
| 3686 | // Check that no objects are still bound before freeing. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3687 | validate("MemoryCheck", len(memoryObject.boundObjects) == 0, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3688 | "vkFreeMemory: objects still bound") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3689 | validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0, |
| 3690 | "vkFreeMemory: commandBuffers still bound") |
| 3691 | State.DeviceMemories[memory] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3692 | } |
| 3693 | |
| 3694 | @threadSafety("app") |
| 3695 | cmd VkResult vkMapMemory( |
| 3696 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3697 | VkDeviceMemory memory, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3698 | VkDeviceSize offset, |
| 3699 | VkDeviceSize size, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3700 | VkMemoryMapFlags flags, |
| 3701 | void** ppData) { |
| 3702 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3703 | memoryObject := GetDeviceMemory(memory) |
| 3704 | assert(memoryObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3705 | |
| 3706 | assert(flags == as!VkMemoryMapFlags(0)) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3707 | assert((offset + size) <= memoryObject.allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3708 | |
| 3709 | return ? |
| 3710 | } |
| 3711 | |
| 3712 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3713 | cmd void vkUnmapMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3714 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3715 | VkDeviceMemory memory) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3716 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3717 | memoryObject := GetDeviceMemory(memory) |
| 3718 | assert(memoryObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3719 | } |
| 3720 | |
| 3721 | cmd VkResult vkFlushMappedMemoryRanges( |
| 3722 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3723 | u32 memoryRangeCount |
| 3724 | const VkMappedMemoryRange* pMemoryRanges) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3725 | deviceObject := GetDevice(device) |
| 3726 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3727 | memoryRanges := pMemoryRanges[0:memoryRangeCount] |
| 3728 | for i in (0 .. memoryRangeCount) { |
| 3729 | memoryRange := memoryRanges[i] |
| 3730 | memoryObject := GetDeviceMemory(memoryRange.memory) |
| 3731 | assert(memoryObject.device == device) |
| 3732 | assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3733 | } |
| 3734 | |
| 3735 | return ? |
| 3736 | } |
| 3737 | |
| 3738 | cmd VkResult vkInvalidateMappedMemoryRanges( |
| 3739 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3740 | u32 memoryRangeCount, |
| 3741 | const VkMappedMemoryRange* pMemoryRanges) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3742 | deviceObject := GetDevice(device) |
| 3743 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3744 | memoryRanges := pMemoryRanges[0:memoryRangeCount] |
| 3745 | for i in (0 .. memoryRangeCount) { |
| 3746 | memoryRange := memoryRanges[i] |
| 3747 | memoryObject := GetDeviceMemory(memoryRange.memory) |
| 3748 | assert(memoryObject.device == device) |
| 3749 | assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3750 | } |
| 3751 | |
| 3752 | return ? |
| 3753 | } |
| 3754 | |
| 3755 | |
| 3756 | // Memory management API functions |
| 3757 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3758 | cmd void vkGetDeviceMemoryCommitment( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3759 | VkDevice device, |
| 3760 | VkDeviceMemory memory, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3761 | VkDeviceSize* pCommittedMemoryInBytes) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3762 | deviceObject := GetDevice(device) |
| 3763 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3764 | if memory != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3765 | memoryObject := GetDeviceMemory(memory) |
| 3766 | assert(memoryObject.device == device) |
| 3767 | } |
| 3768 | |
| 3769 | committedMemoryInBytes := ? |
| 3770 | pCommittedMemoryInBytes[0] = committedMemoryInBytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3771 | } |
| 3772 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3773 | cmd void vkGetBufferMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3774 | VkDevice device, |
| 3775 | VkBuffer buffer, |
| 3776 | VkMemoryRequirements* pMemoryRequirements) { |
| 3777 | deviceObject := GetDevice(device) |
| 3778 | bufferObject := GetBuffer(buffer) |
| 3779 | assert(bufferObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3780 | } |
| 3781 | |
| 3782 | cmd VkResult vkBindBufferMemory( |
| 3783 | VkDevice device, |
| 3784 | VkBuffer buffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3785 | VkDeviceMemory memory, |
| 3786 | VkDeviceSize memoryOffset) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3787 | deviceObject := GetDevice(device) |
| 3788 | bufferObject := GetBuffer(buffer) |
| 3789 | assert(bufferObject.device == device) |
| 3790 | |
| 3791 | // Unbind buffer from previous memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3792 | if bufferObject.memory != NULL_HANDLE { |
| 3793 | memoryObject := GetDeviceMemory(bufferObject.memory) |
| 3794 | memoryObject.boundObjects[as!u64(buffer)] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3795 | } |
| 3796 | |
| 3797 | // Bind buffer to given memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3798 | if memory != NULL_HANDLE { |
| 3799 | memoryObject := GetDeviceMemory(memory) |
| 3800 | assert(memoryObject.device == device) |
| 3801 | memoryObject.boundObjects[as!u64(buffer)] = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3802 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3803 | bufferObject.memory = memory |
| 3804 | bufferObject.memoryOffset = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3805 | |
| 3806 | return ? |
| 3807 | } |
| 3808 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3809 | cmd void vkGetImageMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3810 | VkDevice device, |
| 3811 | VkImage image, |
| 3812 | VkMemoryRequirements* pMemoryRequirements) { |
| 3813 | deviceObject := GetDevice(device) |
| 3814 | imageObject := GetImage(image) |
| 3815 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3816 | } |
| 3817 | |
| 3818 | cmd VkResult vkBindImageMemory( |
| 3819 | VkDevice device, |
| 3820 | VkImage image, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3821 | VkDeviceMemory memory, |
| 3822 | VkDeviceSize memoryOffset) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3823 | deviceObject := GetDevice(device) |
| 3824 | imageObject := GetImage(image) |
| 3825 | assert(imageObject.device == device) |
| 3826 | |
| 3827 | // Unbind image from previous memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3828 | if imageObject.memory != NULL_HANDLE { |
| 3829 | memoryObject := GetDeviceMemory(imageObject.memory) |
| 3830 | memoryObject.boundObjects[as!u64(image)] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3831 | } |
| 3832 | |
| 3833 | // Bind image to given memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3834 | if memory != NULL_HANDLE { |
| 3835 | memoryObject := GetDeviceMemory(memory) |
| 3836 | assert(memoryObject.device == device) |
| 3837 | memoryObject.boundObjects[as!u64(image)] = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3838 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3839 | imageObject.memory = memory |
| 3840 | imageObject.memoryOffset = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3841 | |
| 3842 | return ? |
| 3843 | } |
| 3844 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3845 | cmd void vkGetImageSparseMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3846 | VkDevice device, |
| 3847 | VkImage image, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3848 | u32* pSparseMemoryRequirementCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3849 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { |
| 3850 | deviceObject := GetDevice(device) |
| 3851 | imageObject := GetImage(image) |
| 3852 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3853 | } |
| 3854 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3855 | cmd void vkGetPhysicalDeviceSparseImageFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3856 | VkPhysicalDevice physicalDevice, |
| 3857 | VkFormat format, |
| 3858 | VkImageType type, |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 3859 | VkSampleCountFlagBits samples, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3860 | VkImageUsageFlags usage, |
| 3861 | VkImageTiling tiling, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3862 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3863 | VkSparseImageFormatProperties* pProperties) { |
| 3864 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3865 | } |
| 3866 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 3867 | cmd VkResult vkQueueBindSparse( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3868 | VkQueue queue, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3869 | u32 bindInfoCount, |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 3870 | const VkBindSparseInfo* pBindInfo, |
| 3871 | VkFence fence) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3872 | queueObject := GetQueue(queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3873 | |
| 3874 | return ? |
| 3875 | } |
| 3876 | |
| 3877 | |
| 3878 | // Fence functions |
| 3879 | |
| 3880 | @threadSafety("system") |
| 3881 | cmd VkResult vkCreateFence( |
| 3882 | VkDevice device, |
| 3883 | const VkFenceCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3884 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3885 | VkFence* pFence) { |
| 3886 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO) |
| 3887 | deviceObject := GetDevice(device) |
| 3888 | |
| 3889 | fence := ? |
| 3890 | pFence[0] = fence |
| 3891 | State.Fences[fence] = new!FenceObject( |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3892 | device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT))) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3893 | |
| 3894 | return ? |
| 3895 | } |
| 3896 | |
| 3897 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3898 | cmd void vkDestroyFence( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3899 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3900 | VkFence fence, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3901 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3902 | deviceObject := GetDevice(device) |
| 3903 | fenceObject := GetFence(fence) |
| 3904 | assert(fenceObject.device == device) |
| 3905 | |
| 3906 | State.Fences[fence] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3907 | } |
| 3908 | |
| 3909 | @threadSafety("system") |
| 3910 | cmd VkResult vkResetFences( |
| 3911 | VkDevice device, |
| 3912 | u32 fenceCount, |
| 3913 | const VkFence* pFences) { |
| 3914 | deviceObject := GetDevice(device) |
| 3915 | |
| 3916 | fences := pFences[0:fenceCount] |
| 3917 | for i in (0 .. fenceCount) { |
| 3918 | fence := fences[i] |
| 3919 | fenceObject := GetFence(fence) |
| 3920 | assert(fenceObject.device == device) |
| 3921 | fenceObject.signaled = false |
| 3922 | } |
| 3923 | |
| 3924 | return ? |
| 3925 | } |
| 3926 | |
| 3927 | @threadSafety("system") |
| 3928 | cmd VkResult vkGetFenceStatus( |
| 3929 | VkDevice device, |
| 3930 | VkFence fence) { |
| 3931 | deviceObject := GetDevice(device) |
| 3932 | fenceObject := GetFence(fence) |
| 3933 | assert(fenceObject.device == device) |
| 3934 | |
| 3935 | return ? |
| 3936 | } |
| 3937 | |
| 3938 | @threadSafety("system") |
| 3939 | cmd VkResult vkWaitForFences( |
| 3940 | VkDevice device, |
| 3941 | u32 fenceCount, |
| 3942 | const VkFence* pFences, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3943 | VkBool32 waitAll, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3944 | u64 timeout) { /// timeout in nanoseconds |
| 3945 | deviceObject := GetDevice(device) |
| 3946 | |
| 3947 | fences := pFences[0:fenceCount] |
| 3948 | for i in (0 .. fenceCount) { |
| 3949 | fence := fences[i] |
| 3950 | fenceObject := GetFence(fence) |
| 3951 | assert(fenceObject.device == device) |
| 3952 | } |
| 3953 | |
| 3954 | return ? |
| 3955 | } |
| 3956 | |
| 3957 | |
| 3958 | // Queue semaphore functions |
| 3959 | |
| 3960 | @threadSafety("system") |
| 3961 | cmd VkResult vkCreateSemaphore( |
| 3962 | VkDevice device, |
| 3963 | const VkSemaphoreCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3964 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3965 | VkSemaphore* pSemaphore) { |
| 3966 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO) |
| 3967 | deviceObject := GetDevice(device) |
| 3968 | |
| 3969 | semaphore := ? |
| 3970 | pSemaphore[0] = semaphore |
| 3971 | State.Semaphores[semaphore] = new!SemaphoreObject(device: device) |
| 3972 | |
| 3973 | return ? |
| 3974 | } |
| 3975 | |
| 3976 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3977 | cmd void vkDestroySemaphore( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3978 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3979 | VkSemaphore semaphore, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3980 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3981 | deviceObject := GetDevice(device) |
| 3982 | semaphoreObject := GetSemaphore(semaphore) |
| 3983 | assert(semaphoreObject.device == device) |
| 3984 | |
| 3985 | State.Semaphores[semaphore] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3986 | } |
| 3987 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3988 | |
| 3989 | // Event functions |
| 3990 | |
| 3991 | @threadSafety("system") |
| 3992 | cmd VkResult vkCreateEvent( |
| 3993 | VkDevice device, |
| 3994 | const VkEventCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3995 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3996 | VkEvent* pEvent) { |
| 3997 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO) |
| 3998 | deviceObject := GetDevice(device) |
| 3999 | |
| 4000 | event := ? |
| 4001 | pEvent[0] = event |
| 4002 | State.Events[event] = new!EventObject(device: device) |
| 4003 | |
| 4004 | return ? |
| 4005 | } |
| 4006 | |
| 4007 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4008 | cmd void vkDestroyEvent( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4009 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4010 | VkEvent event, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4011 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4012 | deviceObject := GetDevice(device) |
| 4013 | eventObject := GetEvent(event) |
| 4014 | assert(eventObject.device == device) |
| 4015 | |
| 4016 | State.Events[event] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4017 | } |
| 4018 | |
| 4019 | @threadSafety("system") |
| 4020 | cmd VkResult vkGetEventStatus( |
| 4021 | VkDevice device, |
| 4022 | VkEvent event) { |
| 4023 | deviceObject := GetDevice(device) |
| 4024 | eventObject := GetEvent(event) |
| 4025 | assert(eventObject.device == device) |
| 4026 | |
| 4027 | return ? |
| 4028 | } |
| 4029 | |
| 4030 | @threadSafety("system") |
| 4031 | cmd VkResult vkSetEvent( |
| 4032 | VkDevice device, |
| 4033 | VkEvent event) { |
| 4034 | deviceObject := GetDevice(device) |
| 4035 | eventObject := GetEvent(event) |
| 4036 | assert(eventObject.device == device) |
| 4037 | |
| 4038 | return ? |
| 4039 | } |
| 4040 | |
| 4041 | @threadSafety("system") |
| 4042 | cmd VkResult vkResetEvent( |
| 4043 | VkDevice device, |
| 4044 | VkEvent event) { |
| 4045 | deviceObject := GetDevice(device) |
| 4046 | eventObject := GetEvent(event) |
| 4047 | assert(eventObject.device == device) |
| 4048 | |
| 4049 | return ? |
| 4050 | } |
| 4051 | |
| 4052 | |
| 4053 | // Query functions |
| 4054 | |
| 4055 | @threadSafety("system") |
| 4056 | cmd VkResult vkCreateQueryPool( |
| 4057 | VkDevice device, |
| 4058 | const VkQueryPoolCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4059 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4060 | VkQueryPool* pQueryPool) { |
| 4061 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO) |
| 4062 | deviceObject := GetDevice(device) |
| 4063 | |
| 4064 | queryPool := ? |
| 4065 | pQueryPool[0] = queryPool |
| 4066 | State.QueryPools[queryPool] = new!QueryPoolObject(device: device) |
| 4067 | |
| 4068 | return ? |
| 4069 | } |
| 4070 | |
| 4071 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4072 | cmd void vkDestroyQueryPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4073 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4074 | VkQueryPool queryPool, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4075 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4076 | deviceObject := GetDevice(device) |
| 4077 | queryPoolObject := GetQueryPool(queryPool) |
| 4078 | assert(queryPoolObject.device == device) |
| 4079 | |
| 4080 | State.QueryPools[queryPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4081 | } |
| 4082 | |
| 4083 | @threadSafety("system") |
| 4084 | cmd VkResult vkGetQueryPoolResults( |
| 4085 | VkDevice device, |
| 4086 | VkQueryPool queryPool, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4087 | u32 firstQuery, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4088 | u32 queryCount, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4089 | platform.size_t dataSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4090 | void* pData, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4091 | VkDeviceSize stride, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4092 | VkQueryResultFlags flags) { |
| 4093 | deviceObject := GetDevice(device) |
| 4094 | queryPoolObject := GetQueryPool(queryPool) |
| 4095 | assert(queryPoolObject.device == device) |
| 4096 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4097 | data := pData[0:dataSize] |
| 4098 | |
| 4099 | return ? |
| 4100 | } |
| 4101 | |
| 4102 | // Buffer functions |
| 4103 | |
| 4104 | @threadSafety("system") |
| 4105 | cmd VkResult vkCreateBuffer( |
| 4106 | VkDevice device, |
| 4107 | const VkBufferCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4108 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4109 | VkBuffer* pBuffer) { |
| 4110 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO) |
| 4111 | deviceObject := GetDevice(device) |
| 4112 | |
| 4113 | buffer := ? |
| 4114 | pBuffer[0] = buffer |
| 4115 | State.Buffers[buffer] = new!BufferObject(device: device) |
| 4116 | |
| 4117 | return ? |
| 4118 | } |
| 4119 | |
| 4120 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4121 | cmd void vkDestroyBuffer( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4122 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4123 | VkBuffer buffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4124 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4125 | deviceObject := GetDevice(device) |
| 4126 | bufferObject := GetBuffer(buffer) |
| 4127 | assert(bufferObject.device == device) |
| 4128 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4129 | assert(bufferObject.memory == 0) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4130 | State.Buffers[buffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4131 | } |
| 4132 | |
| 4133 | |
| 4134 | // Buffer view functions |
| 4135 | |
| 4136 | @threadSafety("system") |
| 4137 | cmd VkResult vkCreateBufferView( |
| 4138 | VkDevice device, |
| 4139 | const VkBufferViewCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4140 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4141 | VkBufferView* pView) { |
| 4142 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO) |
| 4143 | deviceObject := GetDevice(device) |
| 4144 | |
| 4145 | bufferObject := GetBuffer(pCreateInfo.buffer) |
| 4146 | assert(bufferObject.device == device) |
| 4147 | |
| 4148 | view := ? |
| 4149 | pView[0] = view |
| 4150 | State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer) |
| 4151 | |
| 4152 | return ? |
| 4153 | } |
| 4154 | |
| 4155 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4156 | cmd void vkDestroyBufferView( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4157 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4158 | VkBufferView bufferView, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4159 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4160 | deviceObject := GetDevice(device) |
| 4161 | bufferViewObject := GetBufferView(bufferView) |
| 4162 | assert(bufferViewObject.device == device) |
| 4163 | |
| 4164 | State.BufferViews[bufferView] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4165 | } |
| 4166 | |
| 4167 | |
| 4168 | // Image functions |
| 4169 | |
| 4170 | @threadSafety("system") |
| 4171 | cmd VkResult vkCreateImage( |
| 4172 | VkDevice device, |
| 4173 | const VkImageCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4174 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4175 | VkImage* pImage) { |
| 4176 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO) |
| 4177 | deviceObject := GetDevice(device) |
| 4178 | |
| 4179 | image := ? |
| 4180 | pImage[0] = image |
| 4181 | State.Images[image] = new!ImageObject(device: device) |
| 4182 | |
| 4183 | return ? |
| 4184 | } |
| 4185 | |
| 4186 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4187 | cmd void vkDestroyImage( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4188 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4189 | VkImage image, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4190 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4191 | deviceObject := GetDevice(device) |
| 4192 | imageObject := GetImage(image) |
| 4193 | assert(imageObject.device == device) |
| 4194 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4195 | assert(imageObject.memory == 0) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4196 | State.Images[image] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4197 | } |
| 4198 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 4199 | cmd void vkGetImageSubresourceLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4200 | VkDevice device, |
| 4201 | VkImage image, |
| 4202 | const VkImageSubresource* pSubresource, |
| 4203 | VkSubresourceLayout* pLayout) { |
| 4204 | deviceObject := GetDevice(device) |
| 4205 | imageObject := GetImage(image) |
| 4206 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4207 | } |
| 4208 | |
| 4209 | |
| 4210 | // Image view functions |
| 4211 | |
| 4212 | @threadSafety("system") |
| 4213 | cmd VkResult vkCreateImageView( |
| 4214 | VkDevice device, |
| 4215 | const VkImageViewCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4216 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4217 | VkImageView* pView) { |
| 4218 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO) |
| 4219 | deviceObject := GetDevice(device) |
| 4220 | |
| 4221 | imageObject := GetImage(pCreateInfo.image) |
| 4222 | assert(imageObject.device == device) |
| 4223 | |
| 4224 | view := ? |
| 4225 | pView[0] = view |
| 4226 | State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image) |
| 4227 | |
| 4228 | return ? |
| 4229 | } |
| 4230 | |
| 4231 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4232 | cmd void vkDestroyImageView( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4233 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4234 | VkImageView imageView, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4235 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4236 | deviceObject := GetDevice(device) |
| 4237 | imageViewObject := GetImageView(imageView) |
| 4238 | assert(imageViewObject.device == device) |
| 4239 | |
| 4240 | State.ImageViews[imageView] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4241 | } |
| 4242 | |
| 4243 | |
| 4244 | // Shader functions |
| 4245 | |
| 4246 | cmd VkResult vkCreateShaderModule( |
| 4247 | VkDevice device, |
| 4248 | const VkShaderModuleCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4249 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4250 | VkShaderModule* pShaderModule) { |
| 4251 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO) |
| 4252 | deviceObject := GetDevice(device) |
| 4253 | |
| 4254 | shaderModule := ? |
| 4255 | pShaderModule[0] = shaderModule |
| 4256 | State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device) |
| 4257 | |
| 4258 | return ? |
| 4259 | } |
| 4260 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4261 | cmd void vkDestroyShaderModule( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4262 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4263 | VkShaderModule shaderModule, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4264 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4265 | deviceObject := GetDevice(device) |
| 4266 | shaderModuleObject := GetShaderModule(shaderModule) |
| 4267 | assert(shaderModuleObject.device == device) |
| 4268 | |
| 4269 | State.ShaderModules[shaderModule] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4270 | } |
| 4271 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4272 | |
| 4273 | // Pipeline functions |
| 4274 | |
| 4275 | cmd VkResult vkCreatePipelineCache( |
| 4276 | VkDevice device, |
| 4277 | const VkPipelineCacheCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4278 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4279 | VkPipelineCache* pPipelineCache) { |
| 4280 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO) |
| 4281 | deviceObject := GetDevice(device) |
| 4282 | |
| 4283 | pipelineCache := ? |
| 4284 | pPipelineCache[0] = pipelineCache |
| 4285 | State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device) |
| 4286 | |
| 4287 | return ? |
| 4288 | } |
| 4289 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4290 | cmd void vkDestroyPipelineCache( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4291 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4292 | VkPipelineCache pipelineCache, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4293 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4294 | deviceObject := GetDevice(device) |
| 4295 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 4296 | assert(pipelineCacheObject.device == device) |
| 4297 | |
| 4298 | State.PipelineCaches[pipelineCache] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4299 | } |
| 4300 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4301 | cmd VkResult vkGetPipelineCacheData( |
| 4302 | VkDevice device, |
| 4303 | VkPipelineCache pipelineCache, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4304 | platform.size_t* pDataSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4305 | void* pData) { |
| 4306 | deviceObject := GetDevice(device) |
| 4307 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 4308 | assert(pipelineCacheObject.device == device) |
| 4309 | |
| 4310 | return ? |
| 4311 | } |
| 4312 | |
| 4313 | cmd VkResult vkMergePipelineCaches( |
| 4314 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4315 | VkPipelineCache dstCache, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4316 | u32 srcCacheCount, |
| 4317 | const VkPipelineCache* pSrcCaches) { |
| 4318 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4319 | dstCacheObject := GetPipelineCache(dstCache) |
| 4320 | assert(dstCacheObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4321 | |
| 4322 | srcCaches := pSrcCaches[0:srcCacheCount] |
| 4323 | for i in (0 .. srcCacheCount) { |
| 4324 | srcCache := srcCaches[i] |
| 4325 | srcCacheObject := GetPipelineCache(srcCache) |
| 4326 | assert(srcCacheObject.device == device) |
| 4327 | } |
| 4328 | |
| 4329 | return ? |
| 4330 | } |
| 4331 | |
| 4332 | cmd VkResult vkCreateGraphicsPipelines( |
| 4333 | VkDevice device, |
| 4334 | VkPipelineCache pipelineCache, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4335 | u32 createInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4336 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4337 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4338 | VkPipeline* pPipelines) { |
| 4339 | deviceObject := GetDevice(device) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4340 | if pipelineCache != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4341 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 4342 | assert(pipelineCacheObject.device == device) |
| 4343 | } |
| 4344 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4345 | createInfos := pCreateInfos[0:createInfoCount] |
| 4346 | pipelines := pPipelines[0:createInfoCount] |
| 4347 | for i in (0 .. createInfoCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4348 | pipeline := ? |
| 4349 | pipelines[i] = pipeline |
| 4350 | State.Pipelines[pipeline] = new!PipelineObject(device: device) |
| 4351 | } |
| 4352 | |
| 4353 | return ? |
| 4354 | } |
| 4355 | |
| 4356 | cmd VkResult vkCreateComputePipelines( |
| 4357 | VkDevice device, |
| 4358 | VkPipelineCache pipelineCache, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4359 | u32 createInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4360 | const VkComputePipelineCreateInfo* pCreateInfos, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4361 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4362 | VkPipeline* pPipelines) { |
| 4363 | deviceObject := GetDevice(device) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4364 | if pipelineCache != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4365 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 4366 | assert(pipelineCacheObject.device == device) |
| 4367 | } |
| 4368 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4369 | createInfos := pCreateInfos[0:createInfoCount] |
| 4370 | pipelines := pPipelines[0:createInfoCount] |
| 4371 | for i in (0 .. createInfoCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4372 | pipeline := ? |
| 4373 | pipelines[i] = pipeline |
| 4374 | State.Pipelines[pipeline] = new!PipelineObject(device: device) |
| 4375 | } |
| 4376 | |
| 4377 | return ? |
| 4378 | } |
| 4379 | |
| 4380 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4381 | cmd void vkDestroyPipeline( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4382 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4383 | VkPipeline pipeline, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4384 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4385 | deviceObject := GetDevice(device) |
| 4386 | pipelineObjects := GetPipeline(pipeline) |
| 4387 | assert(pipelineObjects.device == device) |
| 4388 | |
| 4389 | State.Pipelines[pipeline] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4390 | } |
| 4391 | |
| 4392 | |
| 4393 | // Pipeline layout functions |
| 4394 | |
| 4395 | @threadSafety("system") |
| 4396 | cmd VkResult vkCreatePipelineLayout( |
| 4397 | VkDevice device, |
| 4398 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4399 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4400 | VkPipelineLayout* pPipelineLayout) { |
| 4401 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO) |
| 4402 | deviceObject := GetDevice(device) |
| 4403 | |
| 4404 | pipelineLayout := ? |
| 4405 | pPipelineLayout[0] = pipelineLayout |
| 4406 | State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device) |
| 4407 | |
| 4408 | return ? |
| 4409 | } |
| 4410 | |
| 4411 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4412 | cmd void vkDestroyPipelineLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4413 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4414 | VkPipelineLayout pipelineLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4415 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4416 | deviceObject := GetDevice(device) |
| 4417 | pipelineLayoutObjects := GetPipelineLayout(pipelineLayout) |
| 4418 | assert(pipelineLayoutObjects.device == device) |
| 4419 | |
| 4420 | State.PipelineLayouts[pipelineLayout] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4421 | } |
| 4422 | |
| 4423 | |
| 4424 | // Sampler functions |
| 4425 | |
| 4426 | @threadSafety("system") |
| 4427 | cmd VkResult vkCreateSampler( |
| 4428 | VkDevice device, |
| 4429 | const VkSamplerCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4430 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4431 | VkSampler* pSampler) { |
| 4432 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO) |
| 4433 | deviceObject := GetDevice(device) |
| 4434 | |
| 4435 | sampler := ? |
| 4436 | pSampler[0] = sampler |
| 4437 | State.Samplers[sampler] = new!SamplerObject(device: device) |
| 4438 | |
| 4439 | return ? |
| 4440 | } |
| 4441 | |
| 4442 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4443 | cmd void vkDestroySampler( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4444 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4445 | VkSampler sampler, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4446 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4447 | deviceObject := GetDevice(device) |
| 4448 | samplerObject := GetSampler(sampler) |
| 4449 | assert(samplerObject.device == device) |
| 4450 | |
| 4451 | State.Samplers[sampler] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4452 | } |
| 4453 | |
| 4454 | |
| 4455 | // Descriptor set functions |
| 4456 | |
| 4457 | @threadSafety("system") |
| 4458 | cmd VkResult vkCreateDescriptorSetLayout( |
| 4459 | VkDevice device, |
| 4460 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4461 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4462 | VkDescriptorSetLayout* pSetLayout) { |
| 4463 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO) |
| 4464 | deviceObject := GetDevice(device) |
| 4465 | |
| 4466 | setLayout := ? |
| 4467 | pSetLayout[0] = setLayout |
| 4468 | State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device) |
| 4469 | |
| 4470 | return ? |
| 4471 | } |
| 4472 | |
| 4473 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4474 | cmd void vkDestroyDescriptorSetLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4475 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4476 | VkDescriptorSetLayout descriptorSetLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4477 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4478 | deviceObject := GetDevice(device) |
| 4479 | descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout) |
| 4480 | assert(descriptorSetLayoutObject.device == device) |
| 4481 | |
| 4482 | State.DescriptorSetLayouts[descriptorSetLayout] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4483 | } |
| 4484 | |
| 4485 | @threadSafety("system") |
| 4486 | cmd VkResult vkCreateDescriptorPool( |
| 4487 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4488 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4489 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4490 | VkDescriptorPool* pDescriptorPool) { |
| 4491 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO) |
| 4492 | deviceObject := GetDevice(device) |
| 4493 | |
| 4494 | descriptorPool := ? |
| 4495 | pDescriptorPool[0] = descriptorPool |
| 4496 | State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device) |
| 4497 | |
| 4498 | return ? |
| 4499 | } |
| 4500 | |
| 4501 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4502 | cmd void vkDestroyDescriptorPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4503 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4504 | VkDescriptorPool descriptorPool, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4505 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4506 | deviceObject := GetDevice(device) |
| 4507 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 4508 | assert(descriptorPoolObject.device == device) |
| 4509 | |
| 4510 | State.DescriptorPools[descriptorPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4511 | } |
| 4512 | |
| 4513 | @threadSafety("app") |
| 4514 | cmd VkResult vkResetDescriptorPool( |
| 4515 | VkDevice device, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4516 | VkDescriptorPool descriptorPool, |
| 4517 | VkDescriptorPoolResetFlags flags) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4518 | deviceObject := GetDevice(device) |
| 4519 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 4520 | assert(descriptorPoolObject.device == device) |
| 4521 | |
| 4522 | return ? |
| 4523 | } |
| 4524 | |
| 4525 | @threadSafety("app") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4526 | cmd VkResult vkAllocateDescriptorSets( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4527 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4528 | const VkDescriptorSetAllocateInfo* pAllocateInfo, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4529 | VkDescriptorSet* pDescriptorSets) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4530 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4531 | allocInfo := pAllocateInfo[0] |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4532 | descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4533 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4534 | setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount] |
| 4535 | for i in (0 .. allocInfo.setCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4536 | setLayout := setLayouts[i] |
| 4537 | setLayoutObject := GetDescriptorSetLayout(setLayout) |
| 4538 | assert(setLayoutObject.device == device) |
| 4539 | } |
| 4540 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4541 | descriptorSets := pDescriptorSets[0:allocInfo.setCount] |
| 4542 | for i in (0 .. allocInfo.setCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4543 | descriptorSet := ? |
| 4544 | descriptorSets[i] = descriptorSet |
| 4545 | State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device) |
| 4546 | } |
| 4547 | |
| 4548 | return ? |
| 4549 | } |
| 4550 | |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 4551 | cmd VkResult vkFreeDescriptorSets( |
| 4552 | VkDevice device, |
| 4553 | VkDescriptorPool descriptorPool, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4554 | u32 descriptorSetCount, |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 4555 | const VkDescriptorSet* pDescriptorSets) { |
| 4556 | deviceObject := GetDevice(device) |
| 4557 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 4558 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4559 | descriptorSets := pDescriptorSets[0:descriptorSetCount] |
| 4560 | for i in (0 .. descriptorSetCount) { |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 4561 | descriptorSet := descriptorSets[i] |
| 4562 | descriptorSetObject := GetDescriptorSet(descriptorSet) |
| 4563 | assert(descriptorSetObject.device == device) |
| 4564 | State.DescriptorSets[descriptorSet] = null |
| 4565 | } |
| 4566 | |
| 4567 | return ? |
| 4568 | } |
| 4569 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4570 | cmd void vkUpdateDescriptorSets( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4571 | VkDevice device, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4572 | u32 descriptorWriteCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4573 | const VkWriteDescriptorSet* pDescriptorWrites, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4574 | u32 descriptorCopyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4575 | const VkCopyDescriptorSet* pDescriptorCopies) { |
| 4576 | deviceObject := GetDevice(device) |
| 4577 | |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4578 | descriptorWrites := pDescriptorWrites[0:descriptorWriteCount] |
| 4579 | for i in (0 .. descriptorWriteCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4580 | descriptorWrite := descriptorWrites[i] |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4581 | descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4582 | assert(descriptorWriteObject.device == device) |
| 4583 | } |
| 4584 | |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4585 | descriptorCopies := pDescriptorCopies[0:descriptorCopyCount] |
| 4586 | for i in (0 .. descriptorCopyCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4587 | descriptorCopy := descriptorCopies[i] |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4588 | descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4589 | assert(descriptorCopyObject.device == device) |
| 4590 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4591 | } |
| 4592 | |
| 4593 | |
| 4594 | // Framebuffer functions |
| 4595 | |
| 4596 | @threadSafety("system") |
| 4597 | cmd VkResult vkCreateFramebuffer( |
| 4598 | VkDevice device, |
| 4599 | const VkFramebufferCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4600 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4601 | VkFramebuffer* pFramebuffer) { |
| 4602 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO) |
| 4603 | deviceObject := GetDevice(device) |
| 4604 | |
| 4605 | framebuffer := ? |
| 4606 | pFramebuffer[0] = framebuffer |
| 4607 | State.Framebuffers[framebuffer] = new!FramebufferObject(device: device) |
| 4608 | |
| 4609 | return ? |
| 4610 | } |
| 4611 | |
| 4612 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4613 | cmd void vkDestroyFramebuffer( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4614 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4615 | VkFramebuffer framebuffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4616 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4617 | deviceObject := GetDevice(device) |
| 4618 | framebufferObject := GetFramebuffer(framebuffer) |
| 4619 | assert(framebufferObject.device == device) |
| 4620 | |
| 4621 | State.Framebuffers[framebuffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4622 | } |
| 4623 | |
| 4624 | |
| 4625 | // Renderpass functions |
| 4626 | |
| 4627 | @threadSafety("system") |
| 4628 | cmd VkResult vkCreateRenderPass( |
| 4629 | VkDevice device, |
| 4630 | const VkRenderPassCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4631 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4632 | VkRenderPass* pRenderPass) { |
| 4633 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO) |
| 4634 | deviceObject := GetDevice(device) |
| 4635 | |
| 4636 | renderpass := ? |
| 4637 | pRenderPass[0] = renderpass |
| 4638 | State.RenderPasses[renderpass] = new!RenderPassObject(device: device) |
| 4639 | |
| 4640 | return ? |
| 4641 | } |
| 4642 | |
| 4643 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4644 | cmd void vkDestroyRenderPass( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4645 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4646 | VkRenderPass renderPass, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4647 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4648 | deviceObject := GetDevice(device) |
| 4649 | renderPassObject := GetRenderPass(renderPass) |
| 4650 | assert(renderPassObject.device == device) |
| 4651 | |
| 4652 | State.RenderPasses[renderPass] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4653 | } |
| 4654 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 4655 | cmd void vkGetRenderAreaGranularity( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4656 | VkDevice device, |
| 4657 | VkRenderPass renderPass, |
| 4658 | VkExtent2D* pGranularity) { |
| 4659 | deviceObject := GetDevice(device) |
| 4660 | renderPassObject := GetRenderPass(renderPass) |
| 4661 | |
| 4662 | granularity := ? |
| 4663 | pGranularity[0] = granularity |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4664 | } |
| 4665 | |
| 4666 | // Command pool functions |
| 4667 | |
| 4668 | cmd VkResult vkCreateCommandPool( |
| 4669 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4670 | const VkCommandPoolCreateInfo* pCreateInfo, |
| 4671 | const VkAllocationCallbacks* pAllocator, |
| 4672 | VkCommandPool* pCommandPool) { |
| 4673 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4674 | deviceObject := GetDevice(device) |
| 4675 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4676 | commandPool := ? |
| 4677 | pCommandPool[0] = commandPool |
| 4678 | State.CommandPools[commandPool] = new!CommandPoolObject(device: device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4679 | |
| 4680 | return ? |
| 4681 | } |
| 4682 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4683 | cmd void vkDestroyCommandPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4684 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4685 | VkCommandPool commandPool, |
| 4686 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4687 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4688 | commandPoolObject := GetCommandPool(commandPool) |
| 4689 | assert(commandPoolObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4690 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4691 | State.CommandPools[commandPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4692 | } |
| 4693 | |
| 4694 | cmd VkResult vkResetCommandPool( |
| 4695 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4696 | VkCommandPool commandPool, |
| 4697 | VkCommandPoolResetFlags flags) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4698 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4699 | commandPoolObject := GetCommandPool(commandPool) |
| 4700 | assert(commandPoolObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4701 | |
| 4702 | return ? |
| 4703 | } |
| 4704 | |
| 4705 | // Command buffer functions |
| 4706 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4707 | macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) { |
| 4708 | memoryObject := GetDeviceMemory(memory) |
| 4709 | memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4710 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4711 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4712 | commandBufferObject.boundObjects[as!u64(obj)] = memory |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4713 | } |
| 4714 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4715 | macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) { |
| 4716 | memoryObject := GetDeviceMemory(memory) |
| 4717 | memoryObject.boundCommandBuffers[commandBuffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4718 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4719 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4720 | commandBufferObject.boundObjects[as!u64(obj)] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4721 | } |
| 4722 | |
| 4723 | @threadSafety("system") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4724 | cmd VkResult vkAllocateCommandBuffers( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4725 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4726 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 4727 | VkCommandBuffer* pCommandBuffers) { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 4728 | assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4729 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 4730 | count := pAllocateInfo[0].commandBufferCount |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4731 | commandBuffers := pCommandBuffers[0:count] |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4732 | for i in (0 .. count) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4733 | commandBuffer := ? |
| 4734 | commandBuffers[i] = commandBuffer |
| 4735 | State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4736 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4737 | |
| 4738 | return ? |
| 4739 | } |
| 4740 | |
| 4741 | @threadSafety("system") |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4742 | cmd void vkFreeCommandBuffers( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4743 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4744 | VkCommandPool commandPool, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4745 | u32 commandBufferCount, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4746 | const VkCommandBuffer* pCommandBuffers) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4747 | deviceObject := GetDevice(device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4748 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4749 | commandBuffers := pCommandBuffers[0:commandBufferCount] |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4750 | for i in (0 .. commandBufferCount) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4751 | commandBufferObject := GetCommandBuffer(commandBuffers[i]) |
| 4752 | assert(commandBufferObject.device == device) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4753 | // TODO: iterate over boundObjects and clear memory bindings |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4754 | State.CommandBuffers[commandBuffers[i]] = null |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 4755 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4756 | } |
| 4757 | |
| 4758 | @threadSafety("app") |
| 4759 | cmd VkResult vkBeginCommandBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4760 | VkCommandBuffer commandBuffer, |
| 4761 | const VkCommandBufferBeginInfo* pBeginInfo) { |
| 4762 | assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO) |
| 4763 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4764 | |
| 4765 | // TODO: iterate over boundObjects and clear memory bindings |
| 4766 | |
| 4767 | return ? |
| 4768 | } |
| 4769 | |
| 4770 | @threadSafety("app") |
| 4771 | cmd VkResult vkEndCommandBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4772 | VkCommandBuffer commandBuffer) { |
| 4773 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4774 | |
| 4775 | return ? |
| 4776 | } |
| 4777 | |
| 4778 | @threadSafety("app") |
| 4779 | cmd VkResult vkResetCommandBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4780 | VkCommandBuffer commandBuffer, |
| 4781 | VkCommandBufferResetFlags flags) { |
| 4782 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4783 | |
| 4784 | // TODO: iterate over boundObjects and clear memory bindings |
| 4785 | |
| 4786 | return ? |
| 4787 | } |
| 4788 | |
| 4789 | |
| 4790 | // Command buffer building functions |
| 4791 | |
| 4792 | @threadSafety("app") |
| 4793 | cmd void vkCmdBindPipeline( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4794 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4795 | VkPipelineBindPoint pipelineBindPoint, |
| 4796 | VkPipeline pipeline) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4797 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4798 | pipelineObject := GetPipeline(pipeline) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4799 | assert(commandBufferObject.device == pipelineObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4800 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4801 | queue := switch (pipelineBindPoint) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4802 | case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT |
| 4803 | case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT |
| 4804 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4805 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4806 | } |
| 4807 | |
| 4808 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4809 | cmd void vkCmdSetViewport( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4810 | VkCommandBuffer commandBuffer, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4811 | u32 firstViewport, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4812 | u32 viewportCount, |
| 4813 | const VkViewport* pViewports) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4814 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4815 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4816 | } |
| 4817 | |
| 4818 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4819 | cmd void vkCmdSetScissor( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4820 | VkCommandBuffer commandBuffer, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4821 | u32 firstScissor, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4822 | u32 scissorCount, |
| 4823 | const VkRect2D* pScissors) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4824 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4825 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4826 | } |
| 4827 | |
| 4828 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4829 | cmd void vkCmdSetLineWidth( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4830 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4831 | f32 lineWidth) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4832 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4833 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4834 | } |
| 4835 | |
| 4836 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4837 | cmd void vkCmdSetDepthBias( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4838 | VkCommandBuffer commandBuffer, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4839 | f32 depthBiasConstantFactor, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4840 | f32 depthBiasClamp, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4841 | f32 depthBiasSlopeFactor) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4842 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4843 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4844 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4845 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4846 | @threadSafety("app") |
| 4847 | cmd void vkCmdSetBlendConstants( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4848 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4849 | // TODO(jessehall): apic only supports 'const' on pointer types. Using |
| 4850 | // an annotation as a quick hack to pass this to the template without |
| 4851 | // having to modify the AST and semantic model. |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4852 | @readonly f32[4] blendConstants) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4853 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4854 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4855 | } |
| 4856 | |
| 4857 | @threadSafety("app") |
| 4858 | cmd void vkCmdSetDepthBounds( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4859 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4860 | f32 minDepthBounds, |
| 4861 | f32 maxDepthBounds) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4862 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4863 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4864 | } |
| 4865 | |
| 4866 | @threadSafety("app") |
| 4867 | cmd void vkCmdSetStencilCompareMask( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4868 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4869 | VkStencilFaceFlags faceMask, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4870 | u32 compareMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4871 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4872 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4873 | } |
| 4874 | |
| 4875 | @threadSafety("app") |
| 4876 | cmd void vkCmdSetStencilWriteMask( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4877 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4878 | VkStencilFaceFlags faceMask, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4879 | u32 writeMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4880 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4881 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4882 | } |
| 4883 | |
| 4884 | @threadSafety("app") |
| 4885 | cmd void vkCmdSetStencilReference( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4886 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4887 | VkStencilFaceFlags faceMask, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4888 | u32 reference) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4889 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4890 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4891 | } |
| 4892 | |
| 4893 | @threadSafety("app") |
| 4894 | cmd void vkCmdBindDescriptorSets( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4895 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4896 | VkPipelineBindPoint pipelineBindPoint, |
| 4897 | VkPipelineLayout layout, |
| 4898 | u32 firstSet, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4899 | u32 descriptorSetCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4900 | const VkDescriptorSet* pDescriptorSets, |
| 4901 | u32 dynamicOffsetCount, |
| 4902 | const u32* pDynamicOffsets) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4903 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4904 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4905 | descriptorSets := pDescriptorSets[0:descriptorSetCount] |
| 4906 | for i in (0 .. descriptorSetCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4907 | descriptorSet := descriptorSets[i] |
| 4908 | descriptorSetObject := GetDescriptorSet(descriptorSet) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4909 | assert(commandBufferObject.device == descriptorSetObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4910 | } |
| 4911 | |
| 4912 | dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount] |
| 4913 | for i in (0 .. dynamicOffsetCount) { |
| 4914 | dynamicOffset := dynamicOffsets[i] |
| 4915 | } |
| 4916 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4917 | queue := switch (pipelineBindPoint) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4918 | case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT |
| 4919 | case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT |
| 4920 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4921 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4922 | } |
| 4923 | |
| 4924 | @threadSafety("app") |
| 4925 | cmd void vkCmdBindIndexBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4926 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4927 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4928 | VkDeviceSize offset, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4929 | VkIndexType indexType) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4930 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4931 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4932 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4933 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4934 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4935 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4936 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4937 | } |
| 4938 | |
| 4939 | @threadSafety("app") |
| 4940 | cmd void vkCmdBindVertexBuffers( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4941 | VkCommandBuffer commandBuffer, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4942 | u32 firstBinding, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4943 | u32 bindingCount, |
| 4944 | const VkBuffer* pBuffers, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4945 | const VkDeviceSize* pOffsets) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4946 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4947 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4948 | // TODO: check if not [firstBinding:firstBinding+bindingCount] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4949 | buffers := pBuffers[0:bindingCount] |
| 4950 | offsets := pOffsets[0:bindingCount] |
| 4951 | for i in (0 .. bindingCount) { |
| 4952 | buffer := buffers[i] |
| 4953 | offset := offsets[i] |
| 4954 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4955 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4956 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4957 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4958 | } |
| 4959 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4960 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4961 | } |
| 4962 | |
| 4963 | @threadSafety("app") |
| 4964 | cmd void vkCmdDraw( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4965 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4966 | u32 vertexCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4967 | u32 instanceCount, |
| 4968 | u32 firstVertex, |
| 4969 | u32 firstInstance) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4970 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4971 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4972 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4973 | } |
| 4974 | |
| 4975 | @threadSafety("app") |
| 4976 | cmd void vkCmdDrawIndexed( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4977 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4978 | u32 indexCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4979 | u32 instanceCount, |
| 4980 | u32 firstIndex, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4981 | s32 vertexOffset, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4982 | u32 firstInstance) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4983 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4984 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4985 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4986 | } |
| 4987 | |
| 4988 | @threadSafety("app") |
| 4989 | cmd void vkCmdDrawIndirect( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4990 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4991 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4992 | VkDeviceSize offset, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4993 | u32 drawCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4994 | u32 stride) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4995 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4996 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4997 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4998 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4999 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5000 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5001 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5002 | } |
| 5003 | |
| 5004 | @threadSafety("app") |
| 5005 | cmd void vkCmdDrawIndexedIndirect( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5006 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5007 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 5008 | VkDeviceSize offset, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5009 | u32 drawCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5010 | u32 stride) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5011 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5012 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5013 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5014 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5015 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5016 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5017 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5018 | } |
| 5019 | |
| 5020 | @threadSafety("app") |
| 5021 | cmd void vkCmdDispatch( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5022 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5023 | u32 x, |
| 5024 | u32 y, |
| 5025 | u32 z) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5026 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5027 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5028 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5029 | } |
| 5030 | |
| 5031 | @threadSafety("app") |
| 5032 | cmd void vkCmdDispatchIndirect( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5033 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5034 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 5035 | VkDeviceSize offset) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5036 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5037 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5038 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5039 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5040 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5041 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5042 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5043 | } |
| 5044 | |
| 5045 | @threadSafety("app") |
| 5046 | cmd void vkCmdCopyBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5047 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5048 | VkBuffer srcBuffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5049 | VkBuffer dstBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5050 | u32 regionCount, |
| 5051 | const VkBufferCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5052 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5053 | srcBufferObject := GetBuffer(srcBuffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5054 | dstBufferObject := GetBuffer(dstBuffer) |
| 5055 | assert(commandBufferObject.device == srcBufferObject.device) |
| 5056 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5057 | |
| 5058 | regions := pRegions[0:regionCount] |
| 5059 | for i in (0 .. regionCount) { |
| 5060 | region := regions[i] |
| 5061 | } |
| 5062 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5063 | bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory) |
| 5064 | bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5065 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5066 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5067 | } |
| 5068 | |
| 5069 | @threadSafety("app") |
| 5070 | cmd void vkCmdCopyImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5071 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5072 | VkImage srcImage, |
| 5073 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5074 | VkImage dstImage, |
| 5075 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5076 | u32 regionCount, |
| 5077 | const VkImageCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5078 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5079 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5080 | dstImageObject := GetImage(dstImage) |
| 5081 | assert(commandBufferObject.device == srcImageObject.device) |
| 5082 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5083 | |
| 5084 | regions := pRegions[0:regionCount] |
| 5085 | for i in (0 .. regionCount) { |
| 5086 | region := regions[i] |
| 5087 | } |
| 5088 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5089 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 5090 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5091 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5092 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5093 | } |
| 5094 | |
| 5095 | @threadSafety("app") |
| 5096 | cmd void vkCmdBlitImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5097 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5098 | VkImage srcImage, |
| 5099 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5100 | VkImage dstImage, |
| 5101 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5102 | u32 regionCount, |
| 5103 | const VkImageBlit* pRegions, |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 5104 | VkFilter filter) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5105 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5106 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5107 | dstImageObject := GetImage(dstImage) |
| 5108 | assert(commandBufferObject.device == srcImageObject.device) |
| 5109 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5110 | |
| 5111 | regions := pRegions[0:regionCount] |
| 5112 | for i in (0 .. regionCount) { |
| 5113 | region := regions[i] |
| 5114 | } |
| 5115 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5116 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 5117 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5118 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5119 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5120 | } |
| 5121 | |
| 5122 | @threadSafety("app") |
| 5123 | cmd void vkCmdCopyBufferToImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5124 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5125 | VkBuffer srcBuffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5126 | VkImage dstImage, |
| 5127 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5128 | u32 regionCount, |
| 5129 | const VkBufferImageCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5130 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5131 | srcBufferObject := GetBuffer(srcBuffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5132 | dstImageObject := GetImage(dstImage) |
| 5133 | assert(commandBufferObject.device == srcBufferObject.device) |
| 5134 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5135 | |
| 5136 | regions := pRegions[0:regionCount] |
| 5137 | for i in (0 .. regionCount) { |
| 5138 | region := regions[i] |
| 5139 | } |
| 5140 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5141 | bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory) |
| 5142 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5143 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5144 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5145 | } |
| 5146 | |
| 5147 | @threadSafety("app") |
| 5148 | cmd void vkCmdCopyImageToBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5149 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5150 | VkImage srcImage, |
| 5151 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5152 | VkBuffer dstBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5153 | u32 regionCount, |
| 5154 | const VkBufferImageCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5155 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5156 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5157 | dstBufferObject := GetBuffer(dstBuffer) |
| 5158 | assert(commandBufferObject.device == srcImageObject.device) |
| 5159 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5160 | |
| 5161 | regions := pRegions[0:regionCount] |
| 5162 | for i in (0 .. regionCount) { |
| 5163 | region := regions[i] |
| 5164 | } |
| 5165 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5166 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 5167 | bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5168 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5169 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5170 | } |
| 5171 | |
| 5172 | @threadSafety("app") |
| 5173 | cmd void vkCmdUpdateBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5174 | VkCommandBuffer commandBuffer, |
| 5175 | VkBuffer dstBuffer, |
| 5176 | VkDeviceSize dstOffset, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 5177 | VkDeviceSize dataSize, |
Jesse Hall | 56d386a | 2016-07-26 15:20:40 -0700 | [diff] [blame] | 5178 | const void* pData) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5179 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 5180 | dstBufferObject := GetBuffer(dstBuffer) |
| 5181 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5182 | |
| 5183 | data := pData[0:dataSize] |
| 5184 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5185 | bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5186 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5187 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5188 | } |
| 5189 | |
| 5190 | @threadSafety("app") |
| 5191 | cmd void vkCmdFillBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5192 | VkCommandBuffer commandBuffer, |
| 5193 | VkBuffer dstBuffer, |
| 5194 | VkDeviceSize dstOffset, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5195 | VkDeviceSize size, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5196 | u32 data) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5197 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 5198 | dstBufferObject := GetBuffer(dstBuffer) |
| 5199 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5200 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5201 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5202 | } |
| 5203 | |
| 5204 | @threadSafety("app") |
| 5205 | cmd void vkCmdClearColorImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5206 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5207 | VkImage image, |
| 5208 | VkImageLayout imageLayout, |
| 5209 | const VkClearColorValue* pColor, |
| 5210 | u32 rangeCount, |
| 5211 | const VkImageSubresourceRange* pRanges) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5212 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5213 | imageObject := GetImage(image) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5214 | assert(commandBufferObject.device == imageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5215 | |
| 5216 | ranges := pRanges[0:rangeCount] |
| 5217 | for i in (0 .. rangeCount) { |
| 5218 | range := ranges[i] |
| 5219 | } |
| 5220 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5221 | bindCommandBuffer(commandBuffer, image, imageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5222 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5223 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5224 | } |
| 5225 | |
| 5226 | @threadSafety("app") |
| 5227 | cmd void vkCmdClearDepthStencilImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5228 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5229 | VkImage image, |
| 5230 | VkImageLayout imageLayout, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 5231 | const VkClearDepthStencilValue* pDepthStencil, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5232 | u32 rangeCount, |
| 5233 | const VkImageSubresourceRange* pRanges) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5234 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5235 | imageObject := GetImage(image) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5236 | assert(commandBufferObject.device == imageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5237 | |
| 5238 | ranges := pRanges[0:rangeCount] |
| 5239 | for i in (0 .. rangeCount) { |
| 5240 | range := ranges[i] |
| 5241 | } |
| 5242 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5243 | bindCommandBuffer(commandBuffer, image, imageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5244 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5245 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5246 | } |
| 5247 | |
| 5248 | @threadSafety("app") |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 5249 | cmd void vkCmdClearAttachments( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5250 | VkCommandBuffer commandBuffer, |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 5251 | u32 attachmentCount, |
| 5252 | const VkClearAttachment* pAttachments, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5253 | u32 rectCount, |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 5254 | const VkClearRect* pRects) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5255 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5256 | |
| 5257 | rects := pRects[0:rectCount] |
| 5258 | for i in (0 .. rectCount) { |
| 5259 | rect := rects[i] |
| 5260 | } |
| 5261 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5262 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5263 | } |
| 5264 | |
| 5265 | @threadSafety("app") |
| 5266 | cmd void vkCmdResolveImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5267 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5268 | VkImage srcImage, |
| 5269 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5270 | VkImage dstImage, |
| 5271 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5272 | u32 regionCount, |
| 5273 | const VkImageResolve* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5274 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5275 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5276 | dstImageObject := GetImage(dstImage) |
| 5277 | assert(commandBufferObject.device == srcImageObject.device) |
| 5278 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5279 | |
| 5280 | regions := pRegions[0:regionCount] |
| 5281 | for i in (0 .. regionCount) { |
| 5282 | region := regions[i] |
| 5283 | } |
| 5284 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5285 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 5286 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5287 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5288 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5289 | } |
| 5290 | |
| 5291 | @threadSafety("app") |
| 5292 | cmd void vkCmdSetEvent( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5293 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5294 | VkEvent event, |
| 5295 | VkPipelineStageFlags stageMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5296 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5297 | eventObject := GetEvent(event) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5298 | assert(commandBufferObject.device == eventObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5299 | } |
| 5300 | |
| 5301 | @threadSafety("app") |
| 5302 | cmd void vkCmdResetEvent( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5303 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5304 | VkEvent event, |
| 5305 | VkPipelineStageFlags stageMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5306 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5307 | eventObject := GetEvent(event) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5308 | assert(commandBufferObject.device == eventObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5309 | } |
| 5310 | |
| 5311 | @threadSafety("app") |
| 5312 | cmd void vkCmdWaitEvents( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5313 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5314 | u32 eventCount, |
| 5315 | const VkEvent* pEvents, |
| 5316 | VkPipelineStageFlags srcStageMask, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5317 | VkPipelineStageFlags dstStageMask, |
| 5318 | u32 memoryBarrierCount, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5319 | const VkMemoryBarrier* pMemoryBarriers, |
| 5320 | u32 bufferMemoryBarrierCount, |
| 5321 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 5322 | u32 imageMemoryBarrierCount, |
| 5323 | const VkImageMemoryBarrier* pImageMemoryBarriers) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5324 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5325 | |
| 5326 | events := pEvents[0:eventCount] |
| 5327 | for i in (0 .. eventCount) { |
| 5328 | event := events[i] |
| 5329 | eventObject := GetEvent(event) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5330 | assert(commandBufferObject.device == eventObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5331 | } |
| 5332 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5333 | memoryBarriers := pMemoryBarriers[0:memoryBarrierCount] |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5334 | for i in (0 .. memoryBarrierCount) { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5335 | memoryBarrier := memoryBarriers[i] |
| 5336 | } |
| 5337 | bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount] |
| 5338 | for i in (0 .. bufferMemoryBarrierCount) { |
| 5339 | bufferMemoryBarrier := bufferMemoryBarriers[i] |
| 5340 | bufferObject := GetBuffer(bufferMemoryBarrier.buffer) |
| 5341 | assert(bufferObject.device == commandBufferObject.device) |
| 5342 | } |
| 5343 | imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount] |
| 5344 | for i in (0 .. imageMemoryBarrierCount) { |
| 5345 | imageMemoryBarrier := imageMemoryBarriers[i] |
| 5346 | imageObject := GetImage(imageMemoryBarrier.image) |
| 5347 | assert(imageObject.device == commandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5348 | } |
| 5349 | } |
| 5350 | |
| 5351 | @threadSafety("app") |
| 5352 | cmd void vkCmdPipelineBarrier( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5353 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5354 | VkPipelineStageFlags srcStageMask, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5355 | VkPipelineStageFlags dstStageMask, |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 5356 | VkDependencyFlags dependencyFlags, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5357 | u32 memoryBarrierCount, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5358 | const VkMemoryBarrier* pMemoryBarriers, |
| 5359 | u32 bufferMemoryBarrierCount, |
| 5360 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 5361 | u32 imageMemoryBarrierCount, |
| 5362 | const VkImageMemoryBarrier* pImageMemoryBarriers) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5363 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5364 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5365 | memoryBarriers := pMemoryBarriers[0:memoryBarrierCount] |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5366 | for i in (0 .. memoryBarrierCount) { |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5367 | memoryBarrier := memoryBarriers[i] |
| 5368 | } |
| 5369 | bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount] |
| 5370 | for i in (0 .. bufferMemoryBarrierCount) { |
| 5371 | bufferMemoryBarrier := bufferMemoryBarriers[i] |
| 5372 | bufferObject := GetBuffer(bufferMemoryBarrier.buffer) |
| 5373 | assert(bufferObject.device == commandBufferObject.device) |
| 5374 | } |
| 5375 | imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount] |
| 5376 | for i in (0 .. imageMemoryBarrierCount) { |
| 5377 | imageMemoryBarrier := imageMemoryBarriers[i] |
| 5378 | imageObject := GetImage(imageMemoryBarrier.image) |
| 5379 | assert(imageObject.device == commandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5380 | } |
| 5381 | } |
| 5382 | |
| 5383 | @threadSafety("app") |
| 5384 | cmd void vkCmdBeginQuery( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5385 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5386 | VkQueryPool queryPool, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5387 | u32 query, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5388 | VkQueryControlFlags flags) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5389 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5390 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5391 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5392 | } |
| 5393 | |
| 5394 | @threadSafety("app") |
| 5395 | cmd void vkCmdEndQuery( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5396 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5397 | VkQueryPool queryPool, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5398 | u32 query) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5399 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5400 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5401 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5402 | } |
| 5403 | |
| 5404 | @threadSafety("app") |
| 5405 | cmd void vkCmdResetQueryPool( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5406 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5407 | VkQueryPool queryPool, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5408 | u32 firstQuery, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5409 | u32 queryCount) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5410 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5411 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5412 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5413 | } |
| 5414 | |
| 5415 | @threadSafety("app") |
| 5416 | cmd void vkCmdWriteTimestamp( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5417 | VkCommandBuffer commandBuffer, |
Jesse Hall | 6f39a6d | 2015-11-24 11:08:36 -0800 | [diff] [blame] | 5418 | VkPipelineStageFlagBits pipelineStage, |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 5419 | VkQueryPool queryPool, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5420 | u32 query) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5421 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 5422 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5423 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5424 | } |
| 5425 | |
| 5426 | @threadSafety("app") |
| 5427 | cmd void vkCmdCopyQueryPoolResults( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5428 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5429 | VkQueryPool queryPool, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5430 | u32 firstQuery, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5431 | u32 queryCount, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5432 | VkBuffer dstBuffer, |
| 5433 | VkDeviceSize dstOffset, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 5434 | VkDeviceSize stride, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5435 | VkQueryResultFlags flags) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5436 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5437 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5438 | dstBufferObject := GetBuffer(dstBuffer) |
| 5439 | assert(commandBufferObject.device == queryPoolObject.device) |
| 5440 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5441 | } |
| 5442 | |
| 5443 | cmd void vkCmdPushConstants( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5444 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5445 | VkPipelineLayout layout, |
| 5446 | VkShaderStageFlags stageFlags, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5447 | u32 offset, |
| 5448 | u32 size, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 5449 | const void* pValues) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5450 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5451 | layoutObject := GetPipelineLayout(layout) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5452 | assert(commandBufferObject.device == layoutObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5453 | } |
| 5454 | |
| 5455 | @threadSafety("app") |
| 5456 | cmd void vkCmdBeginRenderPass( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5457 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5458 | const VkRenderPassBeginInfo* pRenderPassBegin, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5459 | VkSubpassContents contents) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5460 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5461 | renderPassObject := GetRenderPass(pRenderPassBegin.renderPass) |
| 5462 | framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5463 | assert(commandBufferObject.device == renderPassObject.device) |
| 5464 | assert(commandBufferObject.device == framebufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5465 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5466 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5467 | } |
| 5468 | |
| 5469 | cmd void vkCmdNextSubpass( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5470 | VkCommandBuffer commandBuffer, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5471 | VkSubpassContents contents) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5472 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5473 | } |
| 5474 | |
| 5475 | @threadSafety("app") |
| 5476 | cmd void vkCmdEndRenderPass( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5477 | VkCommandBuffer commandBuffer) { |
| 5478 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5479 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5480 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5481 | } |
| 5482 | |
| 5483 | cmd void vkCmdExecuteCommands( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5484 | VkCommandBuffer commandBuffer, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5485 | u32 commandBufferCount, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5486 | const VkCommandBuffer* pCommandBuffers) { |
| 5487 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5488 | |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5489 | commandBuffers := pCommandBuffers[0:commandBufferCount] |
| 5490 | for i in (0 .. commandBufferCount) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5491 | secondaryCommandBuffer := commandBuffers[i] |
| 5492 | secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer) |
| 5493 | assert(commandBufferObject.device == secondaryCommandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5494 | } |
| 5495 | } |
| 5496 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5497 | @extension("VK_KHR_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5498 | cmd void vkDestroySurfaceKHR( |
| 5499 | VkInstance instance, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5500 | VkSurfaceKHR surface, |
| 5501 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5502 | instanceObject := GetInstance(instance) |
| 5503 | surfaceObject := GetSurface(surface) |
| 5504 | assert(surfaceObject.instance == instance) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5505 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5506 | State.Surfaces[surface] = null |
Jesse Hall | 2818f93 | 2015-11-19 21:19:17 -0800 | [diff] [blame] | 5507 | } |
| 5508 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5509 | @extension("VK_KHR_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5510 | cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5511 | VkPhysicalDevice physicalDevice, |
| 5512 | u32 queueFamilyIndex, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5513 | VkSurfaceKHR surface, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5514 | VkBool32* pSupported) { |
| 5515 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5516 | |
| 5517 | return ? |
| 5518 | } |
| 5519 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5520 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5521 | cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR( |
| 5522 | VkPhysicalDevice physicalDevice, |
| 5523 | VkSurfaceKHR surface, |
| 5524 | VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) { |
| 5525 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5526 | |
| 5527 | surfaceCapabilities := ? |
| 5528 | pSurfaceCapabilities[0] = surfaceCapabilities |
| 5529 | |
| 5530 | return ? |
| 5531 | } |
| 5532 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5533 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5534 | cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR( |
| 5535 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5536 | VkSurfaceKHR surface, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5537 | u32* pSurfaceFormatCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5538 | VkSurfaceFormatKHR* pSurfaceFormats) { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5539 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5540 | |
| 5541 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5542 | pSurfaceFormatCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5543 | surfaceFormats := pSurfaceFormats[0:count] |
| 5544 | |
| 5545 | for i in (0 .. count) { |
| 5546 | surfaceFormat := ? |
| 5547 | surfaceFormats[i] = surfaceFormat |
| 5548 | } |
| 5549 | |
| 5550 | return ? |
| 5551 | } |
| 5552 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5553 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5554 | cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR( |
| 5555 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5556 | VkSurfaceKHR surface, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5557 | u32* pPresentModeCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5558 | VkPresentModeKHR* pPresentModes) { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 5559 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5560 | |
| 5561 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5562 | pPresentModeCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5563 | presentModes := pPresentModes[0:count] |
| 5564 | |
| 5565 | for i in (0 .. count) { |
| 5566 | presentMode := ? |
| 5567 | presentModes[i] = presentMode |
| 5568 | } |
| 5569 | |
| 5570 | return ? |
| 5571 | } |
| 5572 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5573 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5574 | cmd VkResult vkCreateSwapchainKHR( |
| 5575 | VkDevice device, |
| 5576 | const VkSwapchainCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5577 | const VkAllocationCallbacks* pAllocator, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5578 | VkSwapchainKHR* pSwapchain) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5579 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5580 | deviceObject := GetDevice(device) |
| 5581 | |
| 5582 | swapchain := ? |
| 5583 | pSwapchain[0] = swapchain |
| 5584 | State.Swapchains[swapchain] = new!SwapchainObject(device: device) |
| 5585 | |
| 5586 | return ? |
| 5587 | } |
| 5588 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5589 | @extension("VK_KHR_swapchain") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5590 | cmd void vkDestroySwapchainKHR( |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5591 | VkDevice device, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5592 | VkSwapchainKHR swapchain, |
| 5593 | const VkAllocationCallbacks* pAllocator) { |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5594 | deviceObject := GetDevice(device) |
| 5595 | swapchainObject := GetSwapchain(swapchain) |
| 5596 | assert(swapchainObject.device == device) |
| 5597 | |
| 5598 | State.Swapchains[swapchain] = null |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5599 | } |
| 5600 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5601 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5602 | cmd VkResult vkGetSwapchainImagesKHR( |
| 5603 | VkDevice device, |
| 5604 | VkSwapchainKHR swapchain, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5605 | u32* pSwapchainImageCount, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5606 | VkImage* pSwapchainImages) { |
| 5607 | deviceObject := GetDevice(device) |
| 5608 | |
| 5609 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5610 | pSwapchainImageCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5611 | swapchainImages := pSwapchainImages[0:count] |
| 5612 | |
| 5613 | for i in (0 .. count) { |
| 5614 | swapchainImage := ? |
| 5615 | swapchainImages[i] = swapchainImage |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5616 | State.Images[swapchainImage] = new!ImageObject(device: device) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5617 | } |
| 5618 | |
| 5619 | return ? |
| 5620 | } |
| 5621 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5622 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5623 | cmd VkResult vkAcquireNextImageKHR( |
| 5624 | VkDevice device, |
| 5625 | VkSwapchainKHR swapchain, |
| 5626 | u64 timeout, |
| 5627 | VkSemaphore semaphore, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5628 | VkFence fence, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5629 | u32* pImageIndex) { |
| 5630 | deviceObject := GetDevice(device) |
| 5631 | swapchainObject := GetSwapchain(swapchain) |
| 5632 | |
| 5633 | imageIndex := ? |
| 5634 | pImageIndex[0] = imageIndex |
| 5635 | |
| 5636 | return ? |
| 5637 | } |
| 5638 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5639 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5640 | cmd VkResult vkQueuePresentKHR( |
| 5641 | VkQueue queue, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 5642 | const VkPresentInfoKHR* pPresentInfo) { |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5643 | queueObject := GetQueue(queue) |
| 5644 | |
| 5645 | presentInfo := ? |
| 5646 | pPresentInfo[0] = presentInfo |
| 5647 | |
| 5648 | return ? |
| 5649 | } |
| 5650 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5651 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5652 | cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR( |
| 5653 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5654 | u32* pPropertyCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5655 | VkDisplayPropertiesKHR* pProperties) { |
| 5656 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5657 | return ? |
| 5658 | } |
| 5659 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5660 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5661 | cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR( |
| 5662 | VkPhysicalDevice physicalDevice, |
| 5663 | u32* pPropertyCount, |
| 5664 | VkDisplayPlanePropertiesKHR* pProperties) { |
| 5665 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5666 | return ? |
| 5667 | } |
| 5668 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5669 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5670 | cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR( |
| 5671 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 3dd678a | 2016-01-08 21:52:01 -0800 | [diff] [blame] | 5672 | u32 planeIndex, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 5673 | u32* pDisplayCount, |
| 5674 | VkDisplayKHR* pDisplays) { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5675 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5676 | return ? |
| 5677 | } |
| 5678 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5679 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5680 | cmd VkResult vkGetDisplayModePropertiesKHR( |
| 5681 | VkPhysicalDevice physicalDevice, |
| 5682 | VkDisplayKHR display, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 5683 | u32* pPropertyCount, |
| 5684 | VkDisplayModePropertiesKHR* pProperties) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5685 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5686 | return ? |
| 5687 | } |
| 5688 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5689 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5690 | cmd VkResult vkCreateDisplayModeKHR( |
| 5691 | VkPhysicalDevice physicalDevice, |
| 5692 | VkDisplayKHR display, |
| 5693 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5694 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5695 | VkDisplayModeKHR* pMode) { |
| 5696 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5697 | return ? |
| 5698 | } |
| 5699 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5700 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5701 | cmd VkResult vkGetDisplayPlaneCapabilitiesKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5702 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 5703 | VkDisplayModeKHR mode, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5704 | u32 planeIndex, |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5705 | VkDisplayPlaneCapabilitiesKHR* pCapabilities) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5706 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5707 | return ? |
| 5708 | } |
| 5709 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5710 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5711 | cmd VkResult vkCreateDisplayPlaneSurfaceKHR( |
| 5712 | VkInstance instance, |
| 5713 | const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5714 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5715 | VkSurfaceKHR* pSurface) { |
| 5716 | return ? |
| 5717 | } |
| 5718 | |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 5719 | @extension("VK_KHR_display_swapchain") |
| 5720 | cmd VkResult vkCreateSharedSwapchainsKHR( |
| 5721 | VkDevice device, |
| 5722 | u32 swapchainCount, |
| 5723 | const VkSwapchainCreateInfoKHR* pCreateInfos, |
| 5724 | const VkAllocationCallbacks* pAllocator, |
| 5725 | VkSwapchainKHR* pSwapchains) { |
| 5726 | return ? |
| 5727 | } |
| 5728 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5729 | @extension("VK_KHR_xlib_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5730 | cmd VkResult vkCreateXlibSurfaceKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5731 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5732 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5733 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5734 | VkSurfaceKHR* pSurface) { |
| 5735 | instanceObject := GetInstance(instance) |
| 5736 | return ? |
| 5737 | } |
| 5738 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5739 | @extension("VK_KHR_xlib_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5740 | cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR( |
| 5741 | VkPhysicalDevice physicalDevice, |
| 5742 | u32 queueFamilyIndex, |
| 5743 | platform.Display* dpy, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 5744 | platform.VisualID visualID) { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5745 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5746 | return ? |
| 5747 | } |
| 5748 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5749 | @extension("VK_KHR_xcb_surface") |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5750 | cmd VkResult vkCreateXcbSurfaceKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5751 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5752 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5753 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5754 | VkSurfaceKHR* pSurface) { |
| 5755 | instanceObject := GetInstance(instance) |
| 5756 | return ? |
| 5757 | } |
| 5758 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 5759 | @extension("VK_KHR_xcb_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5760 | cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR( |
| 5761 | VkPhysicalDevice physicalDevice, |
| 5762 | u32 queueFamilyIndex, |
| 5763 | platform.xcb_connection_t* connection, |
| 5764 | platform.xcb_visualid_t visual_id) { |
| 5765 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5766 | return ? |
| 5767 | } |
| 5768 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5769 | @extension("VK_KHR_wayland_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5770 | cmd VkResult vkCreateWaylandSurfaceKHR( |
| 5771 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5772 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5773 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5774 | VkSurfaceKHR* pSurface) { |
| 5775 | instanceObject := GetInstance(instance) |
| 5776 | return ? |
| 5777 | } |
| 5778 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5779 | @extension("VK_KHR_wayland_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5780 | cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR( |
| 5781 | VkPhysicalDevice physicalDevice, |
| 5782 | u32 queueFamilyIndex, |
| 5783 | platform.wl_display* display) { |
| 5784 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5785 | return ? |
| 5786 | } |
| 5787 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5788 | @extension("VK_KHR_mir_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5789 | cmd VkResult vkCreateMirSurfaceKHR( |
| 5790 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5791 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5792 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5793 | VkSurfaceKHR* pSurface) { |
| 5794 | instanceObject := GetInstance(instance) |
| 5795 | return ? |
| 5796 | } |
| 5797 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5798 | @extension("VK_KHR_mir_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5799 | cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR( |
| 5800 | VkPhysicalDevice physicalDevice, |
| 5801 | u32 queueFamilyIndex, |
| 5802 | platform.MirConnection* connection) { |
| 5803 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5804 | return ? |
| 5805 | } |
| 5806 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5807 | @extension("VK_KHR_android_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5808 | cmd VkResult vkCreateAndroidSurfaceKHR( |
| 5809 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5810 | const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5811 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5812 | VkSurfaceKHR* pSurface) { |
| 5813 | instanceObject := GetInstance(instance) |
| 5814 | return ? |
| 5815 | } |
| 5816 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5817 | @extension("VK_KHR_win32_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5818 | cmd VkResult vkCreateWin32SurfaceKHR( |
| 5819 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5820 | const VkWin32SurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5821 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5822 | VkSurfaceKHR* pSurface) { |
| 5823 | instanceObject := GetInstance(instance) |
| 5824 | return ? |
| 5825 | } |
| 5826 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5827 | @extension("VK_KHR_win32_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5828 | cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR( |
| 5829 | VkPhysicalDevice physicalDevice, |
| 5830 | u32 queueFamilyIndex) { |
Jesse Hall | e2948d8 | 2016-02-25 04:19:32 -0800 | [diff] [blame] | 5831 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5832 | return ? |
| 5833 | } |
| 5834 | |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 5835 | @extension("VK_ANDROID_native_buffer") |
| 5836 | cmd VkResult vkGetSwapchainGrallocUsageANDROID( |
| 5837 | VkDevice device, |
| 5838 | VkFormat format, |
| 5839 | VkImageUsageFlags imageUsage, |
| 5840 | int* grallocUsage) { |
| 5841 | return ? |
| 5842 | } |
| 5843 | |
| 5844 | @extension("VK_ANDROID_native_buffer") |
Chris Forbes | 8e4438b | 2016-12-07 16:26:49 +1300 | [diff] [blame] | 5845 | cmd VkResult vkGetSwapchainGrallocUsage2ANDROID( |
| 5846 | VkDevice device, |
| 5847 | VkFormat format, |
| 5848 | VkImageUsageFlags imageUsage, |
| 5849 | VkSwapchainImageUsageFlagsANDROID swapchainImageUsage, |
| 5850 | int* grallocUsage) { |
| 5851 | return ? |
| 5852 | } |
| 5853 | |
| 5854 | @extension("VK_ANDROID_native_buffer") |
Chia-I Wu | b262ddc | 2016-03-22 07:38:20 +0800 | [diff] [blame] | 5855 | cmd VkResult vkAcquireImageANDROID( |
| 5856 | VkDevice device, |
| 5857 | VkImage image, |
| 5858 | int nativeFenceFd, |
| 5859 | VkSemaphore semaphore, |
| 5860 | VkFence fence) { |
| 5861 | return ? |
| 5862 | } |
| 5863 | |
| 5864 | @extension("VK_ANDROID_native_buffer") |
| 5865 | cmd VkResult vkQueueSignalReleaseImageANDROID( |
| 5866 | VkQueue queue, |
| 5867 | u32 waitSemaphoreCount, |
| 5868 | const VkSemaphore* pWaitSemaphores, |
| 5869 | VkImage image, |
| 5870 | int* pNativeFenceFd) { |
| 5871 | return ? |
| 5872 | } |
| 5873 | |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 5874 | @extension("VK_GOOGLE_display_timing") |
| 5875 | cmd VkResult vkGetRefreshCycleDurationGOOGLE( |
| 5876 | VkDevice device, |
| 5877 | VkSwapchainKHR swapchain, |
| 5878 | VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) { |
| 5879 | deviceObject := GetDevice(device) |
| 5880 | swapchainObject := GetSwapchain(swapchain) |
| 5881 | |
| 5882 | displayTimingProperties := ? |
| 5883 | pDisplayTimingProperties[0] = displayTimingProperties |
| 5884 | |
| 5885 | return ? |
| 5886 | } |
| 5887 | |
| 5888 | @extension("VK_GOOGLE_display_timing") |
| 5889 | cmd VkResult vkGetPastPresentationTimingGOOGLE( |
| 5890 | VkDevice device, |
| 5891 | VkSwapchainKHR swapchain, |
| 5892 | u32* pPresentationTimingCount, |
| 5893 | VkPastPresentationTimingGOOGLE* pPresentationTimings) { |
Ian Elliott | 4c8bb2a | 2016-12-29 11:07:26 -0700 | [diff] [blame] | 5894 | return ? |
| 5895 | } |
| 5896 | |
Jesse Hall | 715b86a | 2016-01-16 16:34:29 -0800 | [diff] [blame] | 5897 | @extension("VK_EXT_debug_report") |
| 5898 | @external type void* PFN_vkDebugReportCallbackEXT |
| 5899 | @extension("VK_EXT_debug_report") |
| 5900 | @pfn cmd VkBool32 vkDebugReportCallbackEXT( |
| 5901 | VkDebugReportFlagsEXT flags, |
| 5902 | VkDebugReportObjectTypeEXT objectType, |
| 5903 | u64 object, |
| 5904 | platform.size_t location, |
| 5905 | s32 messageCode, |
| 5906 | const char* pLayerPrefix, |
| 5907 | const char* pMessage, |
| 5908 | void* pUserData) { |
| 5909 | return ? |
| 5910 | } |
| 5911 | |
| 5912 | @extension("VK_EXT_debug_report") |
| 5913 | cmd VkResult vkCreateDebugReportCallbackEXT( |
| 5914 | VkInstance instance, |
| 5915 | const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, |
| 5916 | const VkAllocationCallbacks* pAllocator, |
| 5917 | VkDebugReportCallbackEXT* pCallback) { |
| 5918 | return ? |
| 5919 | } |
| 5920 | |
| 5921 | @extension("VK_EXT_debug_report") |
| 5922 | cmd void vkDestroyDebugReportCallbackEXT( |
| 5923 | VkInstance instance, |
| 5924 | VkDebugReportCallbackEXT callback, |
| 5925 | const VkAllocationCallbacks* pAllocator) { |
| 5926 | } |
| 5927 | |
| 5928 | @extension("VK_EXT_debug_report") |
| 5929 | cmd void vkDebugReportMessageEXT( |
| 5930 | VkInstance instance, |
| 5931 | VkDebugReportFlagsEXT flags, |
| 5932 | VkDebugReportObjectTypeEXT objectType, |
| 5933 | u64 object, |
| 5934 | platform.size_t location, |
| 5935 | s32 messageCode, |
| 5936 | const char* pLayerPrefix, |
| 5937 | const char* pMessage) { |
| 5938 | } |
| 5939 | |
Jesse Hall | 2676338 | 2016-05-20 07:13:52 -0700 | [diff] [blame] | 5940 | @extension("VK_EXT_debug_marker") |
| 5941 | cmd VkResult vkDebugMarkerSetObjectTagEXT( |
| 5942 | VkDevice device, |
| 5943 | VkDebugMarkerObjectTagInfoEXT* pTagInfo) { |
| 5944 | return ? |
| 5945 | } |
| 5946 | |
| 5947 | @extension("VK_EXT_debug_marker") |
| 5948 | cmd VkResult vkDebugMarkerSetObjectNameEXT( |
| 5949 | VkDevice device, |
| 5950 | VkDebugMarkerObjectNameInfoEXT* pNameInfo) { |
| 5951 | return ? |
| 5952 | } |
| 5953 | |
| 5954 | @extension("VK_EXT_debug_marker") |
| 5955 | cmd void vkCmdDebugMarkerBeginEXT( |
| 5956 | VkCommandBuffer commandBuffer, |
| 5957 | VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { |
| 5958 | } |
| 5959 | |
| 5960 | @extension("VK_EXT_debug_marker") |
| 5961 | cmd void vkCmdDebugMarkerEndEXT( |
| 5962 | VkCommandBuffer commandBuffer) { |
| 5963 | } |
| 5964 | |
| 5965 | @extension("VK_EXT_debug_marker") |
| 5966 | cmd void vkCmdDebugMarkerInsertEXT( |
| 5967 | VkCommandBuffer commandBuffer, |
| 5968 | VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { |
| 5969 | } |
| 5970 | |
Chris Forbes | 1194ede | 2016-12-30 16:29:25 +1300 | [diff] [blame] | 5971 | @extension("VK_KHR_get_physical_device_properties2") |
| 5972 | cmd void vkGetPhysicalDeviceFeatures2KHR( |
| 5973 | VkPhysicalDevice physicalDevice, |
| 5974 | VkPhysicalDeviceFeatures2KHR* pFeatures) { |
| 5975 | } |
| 5976 | |
| 5977 | @extension("VK_KHR_get_physical_device_properties2") |
| 5978 | cmd void vkGetPhysicalDeviceProperties2KHR( |
| 5979 | VkPhysicalDevice physicalDevice, |
| 5980 | VkPhysicalDeviceProperties2KHR* pProperties) { |
| 5981 | } |
| 5982 | |
| 5983 | @extension("VK_KHR_get_physical_device_properties2") |
| 5984 | cmd void vkGetPhysicalDeviceFormatProperties2KHR( |
| 5985 | VkPhysicalDevice physicalDevice, |
| 5986 | VkFormat format, |
| 5987 | VkFormatProperties2KHR* pFormatProperties) { |
| 5988 | } |
| 5989 | |
| 5990 | @extension("VK_KHR_get_physical_device_properties2") |
| 5991 | cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR( |
| 5992 | VkPhysicalDevice physicalDevice, |
| 5993 | const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, |
| 5994 | VkImageFormatProperties2KHR* pImageFormatProperties) { |
| 5995 | return ? |
| 5996 | } |
| 5997 | |
| 5998 | @extension("VK_KHR_get_physical_device_properties2") |
| 5999 | cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR( |
| 6000 | VkPhysicalDevice physicalDevice, |
| 6001 | u32* pQueueFamilyPropertyCount, |
| 6002 | VkQueueFamilyProperties2KHR* pQueueFamilyProperties) { |
| 6003 | } |
| 6004 | |
| 6005 | @extension("VK_KHR_get_physical_device_properties2") |
| 6006 | cmd void vkGetPhysicalDeviceMemoryProperties2KHR( |
| 6007 | VkPhysicalDevice physicalDevice, |
| 6008 | VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) { |
| 6009 | } |
| 6010 | |
| 6011 | @extension("VK_KHR_get_physical_device_properties2") |
| 6012 | cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 6013 | VkPhysicalDevice physicalDevice, |
| 6014 | const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, |
| 6015 | u32* pPropertyCount, |
| 6016 | VkSparseImageFormatProperties2KHR* pProperties) { |
| 6017 | } |
| 6018 | |
Chris Forbes | 289cb79 | 2016-12-30 15:03:55 +1300 | [diff] [blame] | 6019 | @extension("VK_AMD_draw_indirect_count") |
| 6020 | cmd void vkCmdDrawIndirectCountAMD( |
| 6021 | VkCommandBuffer commandBuffer, |
| 6022 | VkBuffer buffer, |
| 6023 | VkDeviceSize offset, |
| 6024 | VkBuffer countBuffer, |
| 6025 | VkDeviceSize countBufferOffset, |
| 6026 | u32 maxDrawCount, |
| 6027 | u32 stride) { |
| 6028 | } |
| 6029 | |
| 6030 | @extension("VK_AMD_draw_indirect_count") |
| 6031 | cmd void vkCmdDrawIndexedIndirectCountAMD( |
| 6032 | VkCommandBuffer commandBuffer, |
| 6033 | VkBuffer buffer, |
| 6034 | VkDeviceSize offset, |
| 6035 | VkBuffer countBuffer, |
| 6036 | VkDeviceSize countBufferOffset, |
| 6037 | u32 maxDrawCount, |
| 6038 | u32 stride) { |
| 6039 | } |
| 6040 | |
| 6041 | @extension("VK_NV_external_memory_capabilities") |
| 6042 | cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 6043 | VkPhysicalDevice physicalDevice, |
| 6044 | VkFormat format, |
| 6045 | VkImageType type, |
| 6046 | VkImageTiling tiling, |
| 6047 | VkImageUsageFlags usage, |
| 6048 | VkImageCreateFlags flags, |
| 6049 | VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 6050 | VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) { |
| 6051 | return ? |
| 6052 | } |
| 6053 | |
| 6054 | @extension("VK_NV_external_memory_win32") |
| 6055 | cmd VkResult vkGetMemoryWin32HandleNV( |
| 6056 | VkDevice device, |
| 6057 | VkDeviceMemory memory, |
| 6058 | VkExternalMemoryHandleTypeFlagsNV handleType, |
| 6059 | platform.HANDLE* pHandle) { |
| 6060 | return ? |
| 6061 | } |
| 6062 | |
| 6063 | @extension("VK_NV_external_memory_win32") |
| 6064 | cmd void vkCmdProcessCommandsNVX( |
| 6065 | VkCommandBuffer commandBuffer, |
| 6066 | const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) { |
| 6067 | } |
| 6068 | |
| 6069 | @extension("VK_NV_external_memory_win32") |
| 6070 | cmd void vkCmdReserveSpaceForCommandsNVX( |
| 6071 | VkCommandBuffer commandBuffer, |
| 6072 | const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) { |
| 6073 | } |
| 6074 | |
| 6075 | @extension("VK_NV_external_memory_win32") |
| 6076 | cmd VkResult vkCreateIndirectCommandsLayoutNVX( |
| 6077 | VkDevice device, |
| 6078 | const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, |
| 6079 | const VkAllocationCallbacks* pAllocator, |
| 6080 | VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) { |
| 6081 | return ? |
| 6082 | } |
| 6083 | |
| 6084 | @extension("VK_NV_external_memory_win32") |
| 6085 | cmd void vkDestroyIndirectCommandsLayoutNVX( |
| 6086 | VkDevice device, |
| 6087 | VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 6088 | const VkAllocationCallbacks* pAllocator) { |
| 6089 | } |
| 6090 | |
| 6091 | @extension("VK_NV_external_memory_win32") |
| 6092 | cmd VkResult vkCreateObjectTableNVX( |
| 6093 | VkDevice device, |
| 6094 | const VkObjectTableCreateInfoNVX* pCreateInfo, |
| 6095 | const VkAllocationCallbacks* pAllocator, |
| 6096 | VkObjectTableNVX* pObjectTable) { |
| 6097 | return ? |
| 6098 | } |
| 6099 | |
| 6100 | @extension("VK_NV_external_memory_win32") |
| 6101 | cmd void vkDestroyObjectTableNVX( |
| 6102 | VkDevice device, |
| 6103 | VkObjectTableNVX objectTable, |
| 6104 | const VkAllocationCallbacks* pAllocator) { |
| 6105 | } |
| 6106 | |
| 6107 | @extension("VK_NV_external_memory_win32") |
| 6108 | cmd VkResult vkRegisterObjectsNVX( |
| 6109 | VkDevice device, |
| 6110 | VkObjectTableNVX objectTable, |
| 6111 | u32 objectCount, |
| 6112 | const VkObjectTableEntryNVX* const* ppObjectTableEntries, |
| 6113 | const u32* pObjectIndices) { |
| 6114 | return ? |
| 6115 | } |
| 6116 | |
| 6117 | @extension("VK_NV_external_memory_win32") |
| 6118 | cmd VkResult vkUnregisterObjectsNVX( |
| 6119 | VkDevice device, |
| 6120 | VkObjectTableNVX objectTable, |
| 6121 | u32 objectCount, |
| 6122 | const VkObjectEntryTypeNVX* pObjectEntryTypes, |
| 6123 | const u32* pObjectIndices) { |
| 6124 | return ? |
| 6125 | } |
| 6126 | |
| 6127 | @extension("VK_NV_external_memory_win32") |
| 6128 | cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( |
| 6129 | VkPhysicalDevice physicalDevice, |
| 6130 | VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, |
| 6131 | VkDeviceGeneratedCommandsLimitsNVX* pLimits) { |
| 6132 | } |
| 6133 | |
Chris Forbes | 1d5f68c | 2017-01-31 10:17:01 +1300 | [diff] [blame] | 6134 | @extension("VK_KHR_shared_presentable_image") |
Chris Forbes | 2e12cb8 | 2017-01-18 11:45:17 +1300 | [diff] [blame] | 6135 | cmd VkResult vkGetSwapchainStatusKHR( |
| 6136 | VkDevice device, |
| 6137 | VkSwapchainKHR swapchain) { |
| 6138 | return ? |
| 6139 | } |
| 6140 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6141 | |
| 6142 | //////////////// |
| 6143 | // Validation // |
| 6144 | //////////////// |
| 6145 | |
| 6146 | extern void validate(string layerName, bool condition, string message) |
| 6147 | |
| 6148 | |
| 6149 | ///////////////////////////// |
| 6150 | // Internal State Tracking // |
| 6151 | ///////////////////////////// |
| 6152 | |
| 6153 | StateObject State |
| 6154 | |
| 6155 | @internal class StateObject { |
| 6156 | // Dispatchable objects. |
| 6157 | map!(VkInstance, ref!InstanceObject) Instances |
| 6158 | map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices |
| 6159 | map!(VkDevice, ref!DeviceObject) Devices |
| 6160 | map!(VkQueue, ref!QueueObject) Queues |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6161 | map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6162 | |
| 6163 | // Non-dispatchable objects. |
| 6164 | map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories |
| 6165 | map!(VkBuffer, ref!BufferObject) Buffers |
| 6166 | map!(VkBufferView, ref!BufferViewObject) BufferViews |
| 6167 | map!(VkImage, ref!ImageObject) Images |
| 6168 | map!(VkImageView, ref!ImageViewObject) ImageViews |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6169 | map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6170 | map!(VkPipeline, ref!PipelineObject) Pipelines |
| 6171 | map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts |
| 6172 | map!(VkSampler, ref!SamplerObject) Samplers |
| 6173 | map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets |
| 6174 | map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts |
| 6175 | map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6176 | map!(VkFence, ref!FenceObject) Fences |
| 6177 | map!(VkSemaphore, ref!SemaphoreObject) Semaphores |
| 6178 | map!(VkEvent, ref!EventObject) Events |
| 6179 | map!(VkQueryPool, ref!QueryPoolObject) QueryPools |
| 6180 | map!(VkFramebuffer, ref!FramebufferObject) Framebuffers |
| 6181 | map!(VkRenderPass, ref!RenderPassObject) RenderPasses |
| 6182 | map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6183 | map!(VkCommandPool, ref!CommandPoolObject) CommandPools |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 6184 | map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 6185 | map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6186 | } |
| 6187 | |
| 6188 | @internal class InstanceObject { |
| 6189 | } |
| 6190 | |
| 6191 | @internal class PhysicalDeviceObject { |
| 6192 | VkInstance instance |
| 6193 | } |
| 6194 | |
| 6195 | @internal class DeviceObject { |
| 6196 | VkPhysicalDevice physicalDevice |
| 6197 | } |
| 6198 | |
| 6199 | @internal class QueueObject { |
| 6200 | VkDevice device |
| 6201 | VkQueueFlags flags |
| 6202 | } |
| 6203 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6204 | @internal class CommandBufferObject { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6205 | VkDevice device |
| 6206 | map!(u64, VkDeviceMemory) boundObjects |
| 6207 | VkQueueFlags queueFlags |
| 6208 | } |
| 6209 | |
| 6210 | @internal class DeviceMemoryObject { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6211 | VkDevice device |
| 6212 | VkDeviceSize allocationSize |
| 6213 | map!(u64, VkDeviceSize) boundObjects |
| 6214 | map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6215 | } |
| 6216 | |
| 6217 | @internal class BufferObject { |
| 6218 | VkDevice device |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6219 | VkDeviceMemory memory |
| 6220 | VkDeviceSize memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6221 | } |
| 6222 | |
| 6223 | @internal class BufferViewObject { |
| 6224 | VkDevice device |
| 6225 | VkBuffer buffer |
| 6226 | } |
| 6227 | |
| 6228 | @internal class ImageObject { |
| 6229 | VkDevice device |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6230 | VkDeviceMemory memory |
| 6231 | VkDeviceSize memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6232 | } |
| 6233 | |
| 6234 | @internal class ImageViewObject { |
| 6235 | VkDevice device |
| 6236 | VkImage image |
| 6237 | } |
| 6238 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6239 | @internal class ShaderObject { |
| 6240 | VkDevice device |
| 6241 | } |
| 6242 | |
| 6243 | @internal class ShaderModuleObject { |
| 6244 | VkDevice device |
| 6245 | } |
| 6246 | |
| 6247 | @internal class PipelineObject { |
| 6248 | VkDevice device |
| 6249 | } |
| 6250 | |
| 6251 | @internal class PipelineLayoutObject { |
| 6252 | VkDevice device |
| 6253 | } |
| 6254 | |
| 6255 | @internal class SamplerObject { |
| 6256 | VkDevice device |
| 6257 | } |
| 6258 | |
| 6259 | @internal class DescriptorSetObject { |
| 6260 | VkDevice device |
| 6261 | } |
| 6262 | |
| 6263 | @internal class DescriptorSetLayoutObject { |
| 6264 | VkDevice device |
| 6265 | } |
| 6266 | |
| 6267 | @internal class DescriptorPoolObject { |
| 6268 | VkDevice device |
| 6269 | } |
| 6270 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6271 | @internal class FenceObject { |
| 6272 | VkDevice device |
| 6273 | bool signaled |
| 6274 | } |
| 6275 | |
| 6276 | @internal class SemaphoreObject { |
| 6277 | VkDevice device |
| 6278 | } |
| 6279 | |
| 6280 | @internal class EventObject { |
| 6281 | VkDevice device |
| 6282 | } |
| 6283 | |
| 6284 | @internal class QueryPoolObject { |
| 6285 | VkDevice device |
| 6286 | } |
| 6287 | |
| 6288 | @internal class FramebufferObject { |
| 6289 | VkDevice device |
| 6290 | } |
| 6291 | |
| 6292 | @internal class RenderPassObject { |
| 6293 | VkDevice device |
| 6294 | } |
| 6295 | |
| 6296 | @internal class PipelineCacheObject { |
| 6297 | VkDevice device |
| 6298 | } |
| 6299 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6300 | @internal class CommandPoolObject { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6301 | VkDevice device |
| 6302 | } |
| 6303 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 6304 | @internal class SurfaceObject { |
| 6305 | VkInstance instance |
| 6306 | } |
| 6307 | |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 6308 | @internal class SwapchainObject { |
| 6309 | VkDevice device |
| 6310 | } |
| 6311 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6312 | macro ref!InstanceObject GetInstance(VkInstance instance) { |
| 6313 | assert(instance in State.Instances) |
| 6314 | return State.Instances[instance] |
| 6315 | } |
| 6316 | |
| 6317 | macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) { |
| 6318 | assert(physicalDevice in State.PhysicalDevices) |
| 6319 | return State.PhysicalDevices[physicalDevice] |
| 6320 | } |
| 6321 | |
| 6322 | macro ref!DeviceObject GetDevice(VkDevice device) { |
| 6323 | assert(device in State.Devices) |
| 6324 | return State.Devices[device] |
| 6325 | } |
| 6326 | |
| 6327 | macro ref!QueueObject GetQueue(VkQueue queue) { |
| 6328 | assert(queue in State.Queues) |
| 6329 | return State.Queues[queue] |
| 6330 | } |
| 6331 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6332 | macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) { |
| 6333 | assert(commandBuffer in State.CommandBuffers) |
| 6334 | return State.CommandBuffers[commandBuffer] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6335 | } |
| 6336 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6337 | macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) { |
| 6338 | assert(memory in State.DeviceMemories) |
| 6339 | return State.DeviceMemories[memory] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6340 | } |
| 6341 | |
| 6342 | macro ref!BufferObject GetBuffer(VkBuffer buffer) { |
| 6343 | assert(buffer in State.Buffers) |
| 6344 | return State.Buffers[buffer] |
| 6345 | } |
| 6346 | |
| 6347 | macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) { |
| 6348 | assert(bufferView in State.BufferViews) |
| 6349 | return State.BufferViews[bufferView] |
| 6350 | } |
| 6351 | |
| 6352 | macro ref!ImageObject GetImage(VkImage image) { |
| 6353 | assert(image in State.Images) |
| 6354 | return State.Images[image] |
| 6355 | } |
| 6356 | |
| 6357 | macro ref!ImageViewObject GetImageView(VkImageView imageView) { |
| 6358 | assert(imageView in State.ImageViews) |
| 6359 | return State.ImageViews[imageView] |
| 6360 | } |
| 6361 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6362 | macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) { |
| 6363 | assert(shaderModule in State.ShaderModules) |
| 6364 | return State.ShaderModules[shaderModule] |
| 6365 | } |
| 6366 | |
| 6367 | macro ref!PipelineObject GetPipeline(VkPipeline pipeline) { |
| 6368 | assert(pipeline in State.Pipelines) |
| 6369 | return State.Pipelines[pipeline] |
| 6370 | } |
| 6371 | |
| 6372 | macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) { |
| 6373 | assert(pipelineLayout in State.PipelineLayouts) |
| 6374 | return State.PipelineLayouts[pipelineLayout] |
| 6375 | } |
| 6376 | |
| 6377 | macro ref!SamplerObject GetSampler(VkSampler sampler) { |
| 6378 | assert(sampler in State.Samplers) |
| 6379 | return State.Samplers[sampler] |
| 6380 | } |
| 6381 | |
| 6382 | macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) { |
| 6383 | assert(descriptorSet in State.DescriptorSets) |
| 6384 | return State.DescriptorSets[descriptorSet] |
| 6385 | } |
| 6386 | |
| 6387 | macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) { |
| 6388 | assert(descriptorSetLayout in State.DescriptorSetLayouts) |
| 6389 | return State.DescriptorSetLayouts[descriptorSetLayout] |
| 6390 | } |
| 6391 | |
| 6392 | macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) { |
| 6393 | assert(descriptorPool in State.DescriptorPools) |
| 6394 | return State.DescriptorPools[descriptorPool] |
| 6395 | } |
| 6396 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 6397 | macro ref!FenceObject GetFence(VkFence fence) { |
| 6398 | assert(fence in State.Fences) |
| 6399 | return State.Fences[fence] |
| 6400 | } |
| 6401 | |
| 6402 | macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) { |
| 6403 | assert(semaphore in State.Semaphores) |
| 6404 | return State.Semaphores[semaphore] |
| 6405 | } |
| 6406 | |
| 6407 | macro ref!EventObject GetEvent(VkEvent event) { |
| 6408 | assert(event in State.Events) |
| 6409 | return State.Events[event] |
| 6410 | } |
| 6411 | |
| 6412 | macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) { |
| 6413 | assert(queryPool in State.QueryPools) |
| 6414 | return State.QueryPools[queryPool] |
| 6415 | } |
| 6416 | |
| 6417 | macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) { |
| 6418 | assert(framebuffer in State.Framebuffers) |
| 6419 | return State.Framebuffers[framebuffer] |
| 6420 | } |
| 6421 | |
| 6422 | macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) { |
| 6423 | assert(renderPass in State.RenderPasses) |
| 6424 | return State.RenderPasses[renderPass] |
| 6425 | } |
| 6426 | |
| 6427 | macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) { |
| 6428 | assert(pipelineCache in State.PipelineCaches) |
| 6429 | return State.PipelineCaches[pipelineCache] |
| 6430 | } |
| 6431 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 6432 | macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) { |
| 6433 | assert(commandPool in State.CommandPools) |
| 6434 | return State.CommandPools[commandPool] |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 6435 | } |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 6436 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 6437 | macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) { |
| 6438 | assert(surface in State.Surfaces) |
| 6439 | return State.Surfaces[surface] |
| 6440 | } |
| 6441 | |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 6442 | macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) { |
| 6443 | assert(swapchain in State.Swapchains) |
| 6444 | return State.Swapchains[swapchain] |
| 6445 | } |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 6446 | |
| 6447 | macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) { |
| 6448 | return as!VkQueueFlags(as!u32(flags) | as!u32(bit)) |
| 6449 | } |