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