1 // *** THIS FILE IS GENERATED - DO NOT EDIT ***
2 // See helper_file_generator.py for modifications
3
4
5 /***************************************************************************
6 *
7 * Copyright (c) 2015-2019 The Khronos Group Inc.
8 * Copyright (c) 2015-2019 Valve Corporation
9 * Copyright (c) 2015-2019 LunarG, Inc.
10 * Copyright (c) 2015-2019 Google Inc.
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 * Author: Mark Lobodzinski <mark@lunarg.com>
25 * Author: Courtney Goeltzenleuchter <courtneygo@google.com>
26 * Author: Tobin Ehlis <tobine@google.com>
27 * Author: Chris Forbes <chrisforbes@google.com>
28 * Author: John Zulauf<jzulauf@lunarg.com>
29 *
30 ****************************************************************************/
31
32
33 #pragma once
34
35 #include "cast_utils.h"
36
37 // Object Type enum for validation layer internal object handling
38 typedef enum VulkanObjectType {
39 kVulkanObjectTypeUnknown = 0,
40 kVulkanObjectTypeInstance = 1,
41 kVulkanObjectTypePhysicalDevice = 2,
42 kVulkanObjectTypeDevice = 3,
43 kVulkanObjectTypeQueue = 4,
44 kVulkanObjectTypeSemaphore = 5,
45 kVulkanObjectTypeCommandBuffer = 6,
46 kVulkanObjectTypeFence = 7,
47 kVulkanObjectTypeDeviceMemory = 8,
48 kVulkanObjectTypeBuffer = 9,
49 kVulkanObjectTypeImage = 10,
50 kVulkanObjectTypeEvent = 11,
51 kVulkanObjectTypeQueryPool = 12,
52 kVulkanObjectTypeBufferView = 13,
53 kVulkanObjectTypeImageView = 14,
54 kVulkanObjectTypeShaderModule = 15,
55 kVulkanObjectTypePipelineCache = 16,
56 kVulkanObjectTypePipelineLayout = 17,
57 kVulkanObjectTypeRenderPass = 18,
58 kVulkanObjectTypePipeline = 19,
59 kVulkanObjectTypeDescriptorSetLayout = 20,
60 kVulkanObjectTypeSampler = 21,
61 kVulkanObjectTypeDescriptorPool = 22,
62 kVulkanObjectTypeDescriptorSet = 23,
63 kVulkanObjectTypeFramebuffer = 24,
64 kVulkanObjectTypeCommandPool = 25,
65 kVulkanObjectTypeSamplerYcbcrConversion = 26,
66 kVulkanObjectTypeDescriptorUpdateTemplate = 27,
67 kVulkanObjectTypeSurfaceKHR = 28,
68 kVulkanObjectTypeSwapchainKHR = 29,
69 kVulkanObjectTypeDisplayKHR = 30,
70 kVulkanObjectTypeDisplayModeKHR = 31,
71 kVulkanObjectTypeDebugReportCallbackEXT = 32,
72 kVulkanObjectTypeObjectTableNVX = 33,
73 kVulkanObjectTypeIndirectCommandsLayoutNVX = 34,
74 kVulkanObjectTypeDebugUtilsMessengerEXT = 35,
75 kVulkanObjectTypeValidationCacheEXT = 36,
76 kVulkanObjectTypeAccelerationStructureNV = 37,
77 kVulkanObjectTypePerformanceConfigurationINTEL = 38,
78 kVulkanObjectTypeMax = 39,
79 // Aliases for backwards compatibilty of "promoted" types
80 kVulkanObjectTypeDescriptorUpdateTemplateKHR = kVulkanObjectTypeDescriptorUpdateTemplate,
81 kVulkanObjectTypeSamplerYcbcrConversionKHR = kVulkanObjectTypeSamplerYcbcrConversion,
82 } VulkanObjectType;
83
84 // Array of object name strings for OBJECT_TYPE enum conversion
85 static const char * const object_string[kVulkanObjectTypeMax] = {
86 "VkNonDispatchableHandle",
87 "VkInstance",
88 "VkPhysicalDevice",
89 "VkDevice",
90 "VkQueue",
91 "VkSemaphore",
92 "VkCommandBuffer",
93 "VkFence",
94 "VkDeviceMemory",
95 "VkBuffer",
96 "VkImage",
97 "VkEvent",
98 "VkQueryPool",
99 "VkBufferView",
100 "VkImageView",
101 "VkShaderModule",
102 "VkPipelineCache",
103 "VkPipelineLayout",
104 "VkRenderPass",
105 "VkPipeline",
106 "VkDescriptorSetLayout",
107 "VkSampler",
108 "VkDescriptorPool",
109 "VkDescriptorSet",
110 "VkFramebuffer",
111 "VkCommandPool",
112 "VkSamplerYcbcrConversion",
113 "VkDescriptorUpdateTemplate",
114 "VkSurfaceKHR",
115 "VkSwapchainKHR",
116 "VkDisplayKHR",
117 "VkDisplayModeKHR",
118 "VkDebugReportCallbackEXT",
119 "VkObjectTableNVX",
120 "VkIndirectCommandsLayoutNVX",
121 "VkDebugUtilsMessengerEXT",
122 "VkValidationCacheEXT",
123 "VkAccelerationStructureNV",
124 "VkPerformanceConfigurationINTEL",
125 };
126
127 // Helper array to get Vulkan VK_EXT_debug_report object type enum from the internal layers version
128 const VkDebugReportObjectTypeEXT get_debug_report_enum[] = {
129 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeUnknown
130 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, // kVulkanObjectTypeInstance
131 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, // kVulkanObjectTypePhysicalDevice
132 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, // kVulkanObjectTypeDevice
133 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, // kVulkanObjectTypeQueue
134 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, // kVulkanObjectTypeSemaphore
135 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, // kVulkanObjectTypeCommandBuffer
136 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, // kVulkanObjectTypeFence
137 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, // kVulkanObjectTypeDeviceMemory
138 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, // kVulkanObjectTypeBuffer
139 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, // kVulkanObjectTypeImage
140 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT, // kVulkanObjectTypeEvent
141 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, // kVulkanObjectTypeQueryPool
142 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT, // kVulkanObjectTypeBufferView
143 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT, // kVulkanObjectTypeImageView
144 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT, // kVulkanObjectTypeShaderModule
145 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT, // kVulkanObjectTypePipelineCache
146 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT, // kVulkanObjectTypePipelineLayout
147 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, // kVulkanObjectTypeRenderPass
148 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, // kVulkanObjectTypePipeline
149 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT, // kVulkanObjectTypeDescriptorSetLayout
150 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT, // kVulkanObjectTypeSampler
151 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, // kVulkanObjectTypeDescriptorPool
152 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, // kVulkanObjectTypeDescriptorSet
153 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, // kVulkanObjectTypeFramebuffer
154 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT, // kVulkanObjectTypeCommandPool
155 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, // kVulkanObjectTypeSamplerYcbcrConversion
156 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT, // kVulkanObjectTypeDescriptorUpdateTemplate
157 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT, // kVulkanObjectTypeSurfaceKHR
158 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, // kVulkanObjectTypeSwapchainKHR
159 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT, // kVulkanObjectTypeDisplayKHR
160 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT, // kVulkanObjectTypeDisplayModeKHR
161 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, // kVulkanObjectTypeDebugReportCallbackEXT
162 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT, // kVulkanObjectTypeObjectTableNVX
163 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT, // kVulkanObjectTypeIndirectCommandsLayoutNVX
164 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeDebugUtilsMessengerEXT
165 VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, // kVulkanObjectTypeValidationCacheEXT
166 VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT, // kVulkanObjectTypeAccelerationStructureNV
167 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypePerformanceConfigurationINTEL
168 };
169
170 // Helper array to get Official Vulkan VkObjectType enum from the internal layers version
171 const VkObjectType get_object_type_enum[] = {
172 VK_OBJECT_TYPE_UNKNOWN, // kVulkanObjectTypeUnknown
173 VK_OBJECT_TYPE_INSTANCE, // kVulkanObjectTypeInstance
174 VK_OBJECT_TYPE_PHYSICAL_DEVICE, // kVulkanObjectTypePhysicalDevice
175 VK_OBJECT_TYPE_DEVICE, // kVulkanObjectTypeDevice
176 VK_OBJECT_TYPE_QUEUE, // kVulkanObjectTypeQueue
177 VK_OBJECT_TYPE_SEMAPHORE, // kVulkanObjectTypeSemaphore
178 VK_OBJECT_TYPE_COMMAND_BUFFER, // kVulkanObjectTypeCommandBuffer
179 VK_OBJECT_TYPE_FENCE, // kVulkanObjectTypeFence
180 VK_OBJECT_TYPE_DEVICE_MEMORY, // kVulkanObjectTypeDeviceMemory
181 VK_OBJECT_TYPE_BUFFER, // kVulkanObjectTypeBuffer
182 VK_OBJECT_TYPE_IMAGE, // kVulkanObjectTypeImage
183 VK_OBJECT_TYPE_EVENT, // kVulkanObjectTypeEvent
184 VK_OBJECT_TYPE_QUERY_POOL, // kVulkanObjectTypeQueryPool
185 VK_OBJECT_TYPE_BUFFER_VIEW, // kVulkanObjectTypeBufferView
186 VK_OBJECT_TYPE_IMAGE_VIEW, // kVulkanObjectTypeImageView
187 VK_OBJECT_TYPE_SHADER_MODULE, // kVulkanObjectTypeShaderModule
188 VK_OBJECT_TYPE_PIPELINE_CACHE, // kVulkanObjectTypePipelineCache
189 VK_OBJECT_TYPE_PIPELINE_LAYOUT, // kVulkanObjectTypePipelineLayout
190 VK_OBJECT_TYPE_RENDER_PASS, // kVulkanObjectTypeRenderPass
191 VK_OBJECT_TYPE_PIPELINE, // kVulkanObjectTypePipeline
192 VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, // kVulkanObjectTypeDescriptorSetLayout
193 VK_OBJECT_TYPE_SAMPLER, // kVulkanObjectTypeSampler
194 VK_OBJECT_TYPE_DESCRIPTOR_POOL, // kVulkanObjectTypeDescriptorPool
195 VK_OBJECT_TYPE_DESCRIPTOR_SET, // kVulkanObjectTypeDescriptorSet
196 VK_OBJECT_TYPE_FRAMEBUFFER, // kVulkanObjectTypeFramebuffer
197 VK_OBJECT_TYPE_COMMAND_POOL, // kVulkanObjectTypeCommandPool
198 VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, // kVulkanObjectTypeSamplerYcbcrConversion
199 VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, // kVulkanObjectTypeDescriptorUpdateTemplate
200 VK_OBJECT_TYPE_SURFACE_KHR, // kVulkanObjectTypeSurfaceKHR
201 VK_OBJECT_TYPE_SWAPCHAIN_KHR, // kVulkanObjectTypeSwapchainKHR
202 VK_OBJECT_TYPE_DISPLAY_KHR, // kVulkanObjectTypeDisplayKHR
203 VK_OBJECT_TYPE_DISPLAY_MODE_KHR, // kVulkanObjectTypeDisplayModeKHR
204 VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT, // kVulkanObjectTypeDebugReportCallbackEXT
205 VK_OBJECT_TYPE_OBJECT_TABLE_NVX, // kVulkanObjectTypeObjectTableNVX
206 VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX, // kVulkanObjectTypeIndirectCommandsLayoutNVX
207 VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT, // kVulkanObjectTypeDebugUtilsMessengerEXT
208 VK_OBJECT_TYPE_VALIDATION_CACHE_EXT, // kVulkanObjectTypeValidationCacheEXT
209 VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV, // kVulkanObjectTypeAccelerationStructureNV
210 VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL, // kVulkanObjectTypePerformanceConfigurationINTEL
211 };
212
convertDebugReportObjectToCoreObject(VkDebugReportObjectTypeEXT debug_report_obj)213 static inline VkObjectType convertDebugReportObjectToCoreObject(VkDebugReportObjectTypeEXT debug_report_obj) {
214 switch (debug_report_obj) {
215 case VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT: return VK_OBJECT_TYPE_UNKNOWN;
216 case VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT: return VK_OBJECT_TYPE_INSTANCE;
217 case VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT: return VK_OBJECT_TYPE_PHYSICAL_DEVICE;
218 case VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT: return VK_OBJECT_TYPE_DEVICE;
219 case VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT: return VK_OBJECT_TYPE_QUEUE;
220 case VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT: return VK_OBJECT_TYPE_SEMAPHORE;
221 case VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT: return VK_OBJECT_TYPE_COMMAND_BUFFER;
222 case VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT: return VK_OBJECT_TYPE_FENCE;
223 case VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT: return VK_OBJECT_TYPE_DEVICE_MEMORY;
224 case VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT: return VK_OBJECT_TYPE_BUFFER;
225 case VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT: return VK_OBJECT_TYPE_IMAGE;
226 case VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT: return VK_OBJECT_TYPE_EVENT;
227 case VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT: return VK_OBJECT_TYPE_QUERY_POOL;
228 case VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT: return VK_OBJECT_TYPE_BUFFER_VIEW;
229 case VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT: return VK_OBJECT_TYPE_IMAGE_VIEW;
230 case VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT: return VK_OBJECT_TYPE_SHADER_MODULE;
231 case VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT: return VK_OBJECT_TYPE_PIPELINE_CACHE;
232 case VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT: return VK_OBJECT_TYPE_PIPELINE_LAYOUT;
233 case VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT: return VK_OBJECT_TYPE_RENDER_PASS;
234 case VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT: return VK_OBJECT_TYPE_PIPELINE;
235 case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT: return VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT;
236 case VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT: return VK_OBJECT_TYPE_SAMPLER;
237 case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT: return VK_OBJECT_TYPE_DESCRIPTOR_POOL;
238 case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT: return VK_OBJECT_TYPE_DESCRIPTOR_SET;
239 case VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT: return VK_OBJECT_TYPE_FRAMEBUFFER;
240 case VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT: return VK_OBJECT_TYPE_COMMAND_POOL;
241 case VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT: return VK_OBJECT_TYPE_SURFACE_KHR;
242 case VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT: return VK_OBJECT_TYPE_SWAPCHAIN_KHR;
243 case VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT: return VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT;
244 case VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT: return VK_OBJECT_TYPE_DISPLAY_KHR;
245 case VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT: return VK_OBJECT_TYPE_DISPLAY_MODE_KHR;
246 case VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT: return VK_OBJECT_TYPE_OBJECT_TABLE_NVX;
247 case VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT: return VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX;
248 case VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT: return VK_OBJECT_TYPE_VALIDATION_CACHE_EXT;
249 case VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT: return VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION;
250 case VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT: return VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE;
251 case VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT: return VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV;
252 default: return VK_OBJECT_TYPE_UNKNOWN;
253 }
254 }
255
convertCoreObjectToDebugReportObject(VkObjectType core_report_obj)256 static inline VkDebugReportObjectTypeEXT convertCoreObjectToDebugReportObject(VkObjectType core_report_obj) {
257 switch (core_report_obj) {
258 case VK_OBJECT_TYPE_UNKNOWN: return VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;
259 case VK_OBJECT_TYPE_INSTANCE: return VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT;
260 case VK_OBJECT_TYPE_PHYSICAL_DEVICE: return VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT;
261 case VK_OBJECT_TYPE_DEVICE: return VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT;
262 case VK_OBJECT_TYPE_QUEUE: return VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT;
263 case VK_OBJECT_TYPE_SEMAPHORE: return VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT;
264 case VK_OBJECT_TYPE_COMMAND_BUFFER: return VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT;
265 case VK_OBJECT_TYPE_FENCE: return VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT;
266 case VK_OBJECT_TYPE_DEVICE_MEMORY: return VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT;
267 case VK_OBJECT_TYPE_BUFFER: return VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT;
268 case VK_OBJECT_TYPE_IMAGE: return VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT;
269 case VK_OBJECT_TYPE_EVENT: return VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT;
270 case VK_OBJECT_TYPE_QUERY_POOL: return VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT;
271 case VK_OBJECT_TYPE_BUFFER_VIEW: return VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT;
272 case VK_OBJECT_TYPE_IMAGE_VIEW: return VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT;
273 case VK_OBJECT_TYPE_SHADER_MODULE: return VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT;
274 case VK_OBJECT_TYPE_PIPELINE_CACHE: return VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT;
275 case VK_OBJECT_TYPE_PIPELINE_LAYOUT: return VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT;
276 case VK_OBJECT_TYPE_RENDER_PASS: return VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT;
277 case VK_OBJECT_TYPE_PIPELINE: return VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT;
278 case VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT: return VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT;
279 case VK_OBJECT_TYPE_SAMPLER: return VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT;
280 case VK_OBJECT_TYPE_DESCRIPTOR_POOL: return VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT;
281 case VK_OBJECT_TYPE_DESCRIPTOR_SET: return VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT;
282 case VK_OBJECT_TYPE_FRAMEBUFFER: return VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT;
283 case VK_OBJECT_TYPE_COMMAND_POOL: return VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT;
284 case VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION: return VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT;
285 case VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE: return VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT;
286 case VK_OBJECT_TYPE_SURFACE_KHR: return VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT;
287 case VK_OBJECT_TYPE_SWAPCHAIN_KHR: return VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT;
288 case VK_OBJECT_TYPE_DISPLAY_KHR: return VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT;
289 case VK_OBJECT_TYPE_DISPLAY_MODE_KHR: return VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT;
290 case VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT: return VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT;
291 case VK_OBJECT_TYPE_OBJECT_TABLE_NVX: return VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT;
292 case VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX: return VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT;
293 case VK_OBJECT_TYPE_VALIDATION_CACHE_EXT: return VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT;
294 case VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV: return VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT;
295 default: return VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;
296 }
297 }
298
299 // Traits objects from each type statically map from Vk<handleType> to the various enums
300 template <typename VkType> struct VkHandleInfo {};
301 template <VulkanObjectType id> struct VulkanObjectTypeInfo {};
302
303 // The following line must match the vulkan_core.h condition guarding VK_DEFINE_NON_DISPATCHABLE_HANDLE
304 #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
305 #define TYPESAFE_NONDISPATCHABLE_HANDLES
306 #else
307 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkNonDispatchableHandle)
308
309 template <> struct VkHandleInfo<VkNonDispatchableHandle> {
310 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeUnknown;
311 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;
312 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_UNKNOWN;
313 static const char* Typename() {
314 return "VkNonDispatchableHandle";
315 }
316 };
317 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeUnknown> {
318 typedef VkNonDispatchableHandle Type;
319 };
320
321 #endif // VK_DEFINE_HANDLE logic duplication
322 template <> struct VkHandleInfo<VkCommandBuffer> {
323 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeCommandBuffer;
324 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT;
325 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_COMMAND_BUFFER;
326 static const char* Typename() {
327 return "VkCommandBuffer";
328 }
329 };
330 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeCommandBuffer> {
331 typedef VkCommandBuffer Type;
332 };
333 template <> struct VkHandleInfo<VkDevice> {
334 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeDevice;
335 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT;
336 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_DEVICE;
337 static const char* Typename() {
338 return "VkDevice";
339 }
340 };
341 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeDevice> {
342 typedef VkDevice Type;
343 };
344 template <> struct VkHandleInfo<VkInstance> {
345 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeInstance;
346 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT;
347 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_INSTANCE;
348 static const char* Typename() {
349 return "VkInstance";
350 }
351 };
352 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeInstance> {
353 typedef VkInstance Type;
354 };
355 template <> struct VkHandleInfo<VkPhysicalDevice> {
356 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypePhysicalDevice;
357 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT;
358 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_PHYSICAL_DEVICE;
359 static const char* Typename() {
360 return "VkPhysicalDevice";
361 }
362 };
363 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypePhysicalDevice> {
364 typedef VkPhysicalDevice Type;
365 };
366 template <> struct VkHandleInfo<VkQueue> {
367 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeQueue;
368 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT;
369 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_QUEUE;
370 static const char* Typename() {
371 return "VkQueue";
372 }
373 };
374 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeQueue> {
375 typedef VkQueue Type;
376 };
377 #ifdef TYPESAFE_NONDISPATCHABLE_HANDLES
378 template <> struct VkHandleInfo<VkAccelerationStructureNV> {
379 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeAccelerationStructureNV;
380 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT;
381 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV;
382 static const char* Typename() {
383 return "VkAccelerationStructureNV";
384 }
385 };
386 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeAccelerationStructureNV> {
387 typedef VkAccelerationStructureNV Type;
388 };
389 template <> struct VkHandleInfo<VkBuffer> {
390 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeBuffer;
391 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT;
392 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_BUFFER;
393 static const char* Typename() {
394 return "VkBuffer";
395 }
396 };
397 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeBuffer> {
398 typedef VkBuffer Type;
399 };
400 template <> struct VkHandleInfo<VkBufferView> {
401 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeBufferView;
402 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT;
403 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_BUFFER_VIEW;
404 static const char* Typename() {
405 return "VkBufferView";
406 }
407 };
408 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeBufferView> {
409 typedef VkBufferView Type;
410 };
411 template <> struct VkHandleInfo<VkCommandPool> {
412 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeCommandPool;
413 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT;
414 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_COMMAND_POOL;
415 static const char* Typename() {
416 return "VkCommandPool";
417 }
418 };
419 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeCommandPool> {
420 typedef VkCommandPool Type;
421 };
422 template <> struct VkHandleInfo<VkDebugReportCallbackEXT> {
423 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeDebugReportCallbackEXT;
424 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT;
425 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT;
426 static const char* Typename() {
427 return "VkDebugReportCallbackEXT";
428 }
429 };
430 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeDebugReportCallbackEXT> {
431 typedef VkDebugReportCallbackEXT Type;
432 };
433 template <> struct VkHandleInfo<VkDebugUtilsMessengerEXT> {
434 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeDebugUtilsMessengerEXT;
435 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;
436 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT;
437 static const char* Typename() {
438 return "VkDebugUtilsMessengerEXT";
439 }
440 };
441 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeDebugUtilsMessengerEXT> {
442 typedef VkDebugUtilsMessengerEXT Type;
443 };
444 template <> struct VkHandleInfo<VkDescriptorPool> {
445 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeDescriptorPool;
446 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT;
447 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_DESCRIPTOR_POOL;
448 static const char* Typename() {
449 return "VkDescriptorPool";
450 }
451 };
452 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeDescriptorPool> {
453 typedef VkDescriptorPool Type;
454 };
455 template <> struct VkHandleInfo<VkDescriptorSet> {
456 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeDescriptorSet;
457 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT;
458 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_DESCRIPTOR_SET;
459 static const char* Typename() {
460 return "VkDescriptorSet";
461 }
462 };
463 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeDescriptorSet> {
464 typedef VkDescriptorSet Type;
465 };
466 template <> struct VkHandleInfo<VkDescriptorSetLayout> {
467 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeDescriptorSetLayout;
468 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT;
469 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT;
470 static const char* Typename() {
471 return "VkDescriptorSetLayout";
472 }
473 };
474 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeDescriptorSetLayout> {
475 typedef VkDescriptorSetLayout Type;
476 };
477 template <> struct VkHandleInfo<VkDescriptorUpdateTemplate> {
478 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeDescriptorUpdateTemplate;
479 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT;
480 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE;
481 static const char* Typename() {
482 return "VkDescriptorUpdateTemplate";
483 }
484 };
485 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeDescriptorUpdateTemplate> {
486 typedef VkDescriptorUpdateTemplate Type;
487 };
488 template <> struct VkHandleInfo<VkDeviceMemory> {
489 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeDeviceMemory;
490 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT;
491 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_DEVICE_MEMORY;
492 static const char* Typename() {
493 return "VkDeviceMemory";
494 }
495 };
496 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeDeviceMemory> {
497 typedef VkDeviceMemory Type;
498 };
499 template <> struct VkHandleInfo<VkDisplayKHR> {
500 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeDisplayKHR;
501 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT;
502 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_DISPLAY_KHR;
503 static const char* Typename() {
504 return "VkDisplayKHR";
505 }
506 };
507 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeDisplayKHR> {
508 typedef VkDisplayKHR Type;
509 };
510 template <> struct VkHandleInfo<VkDisplayModeKHR> {
511 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeDisplayModeKHR;
512 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT;
513 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_DISPLAY_MODE_KHR;
514 static const char* Typename() {
515 return "VkDisplayModeKHR";
516 }
517 };
518 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeDisplayModeKHR> {
519 typedef VkDisplayModeKHR Type;
520 };
521 template <> struct VkHandleInfo<VkEvent> {
522 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeEvent;
523 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT;
524 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_EVENT;
525 static const char* Typename() {
526 return "VkEvent";
527 }
528 };
529 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeEvent> {
530 typedef VkEvent Type;
531 };
532 template <> struct VkHandleInfo<VkFence> {
533 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeFence;
534 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT;
535 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_FENCE;
536 static const char* Typename() {
537 return "VkFence";
538 }
539 };
540 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeFence> {
541 typedef VkFence Type;
542 };
543 template <> struct VkHandleInfo<VkFramebuffer> {
544 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeFramebuffer;
545 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT;
546 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_FRAMEBUFFER;
547 static const char* Typename() {
548 return "VkFramebuffer";
549 }
550 };
551 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeFramebuffer> {
552 typedef VkFramebuffer Type;
553 };
554 template <> struct VkHandleInfo<VkImage> {
555 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeImage;
556 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT;
557 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_IMAGE;
558 static const char* Typename() {
559 return "VkImage";
560 }
561 };
562 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeImage> {
563 typedef VkImage Type;
564 };
565 template <> struct VkHandleInfo<VkImageView> {
566 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeImageView;
567 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT;
568 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_IMAGE_VIEW;
569 static const char* Typename() {
570 return "VkImageView";
571 }
572 };
573 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeImageView> {
574 typedef VkImageView Type;
575 };
576 template <> struct VkHandleInfo<VkIndirectCommandsLayoutNVX> {
577 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeIndirectCommandsLayoutNVX;
578 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT;
579 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX;
580 static const char* Typename() {
581 return "VkIndirectCommandsLayoutNVX";
582 }
583 };
584 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeIndirectCommandsLayoutNVX> {
585 typedef VkIndirectCommandsLayoutNVX Type;
586 };
587 template <> struct VkHandleInfo<VkObjectTableNVX> {
588 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeObjectTableNVX;
589 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT;
590 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_OBJECT_TABLE_NVX;
591 static const char* Typename() {
592 return "VkObjectTableNVX";
593 }
594 };
595 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeObjectTableNVX> {
596 typedef VkObjectTableNVX Type;
597 };
598 template <> struct VkHandleInfo<VkPerformanceConfigurationINTEL> {
599 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypePerformanceConfigurationINTEL;
600 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;
601 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL;
602 static const char* Typename() {
603 return "VkPerformanceConfigurationINTEL";
604 }
605 };
606 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypePerformanceConfigurationINTEL> {
607 typedef VkPerformanceConfigurationINTEL Type;
608 };
609 template <> struct VkHandleInfo<VkPipeline> {
610 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypePipeline;
611 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT;
612 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_PIPELINE;
613 static const char* Typename() {
614 return "VkPipeline";
615 }
616 };
617 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypePipeline> {
618 typedef VkPipeline Type;
619 };
620 template <> struct VkHandleInfo<VkPipelineCache> {
621 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypePipelineCache;
622 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT;
623 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_PIPELINE_CACHE;
624 static const char* Typename() {
625 return "VkPipelineCache";
626 }
627 };
628 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypePipelineCache> {
629 typedef VkPipelineCache Type;
630 };
631 template <> struct VkHandleInfo<VkPipelineLayout> {
632 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypePipelineLayout;
633 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT;
634 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_PIPELINE_LAYOUT;
635 static const char* Typename() {
636 return "VkPipelineLayout";
637 }
638 };
639 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypePipelineLayout> {
640 typedef VkPipelineLayout Type;
641 };
642 template <> struct VkHandleInfo<VkQueryPool> {
643 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeQueryPool;
644 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT;
645 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_QUERY_POOL;
646 static const char* Typename() {
647 return "VkQueryPool";
648 }
649 };
650 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeQueryPool> {
651 typedef VkQueryPool Type;
652 };
653 template <> struct VkHandleInfo<VkRenderPass> {
654 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeRenderPass;
655 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT;
656 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_RENDER_PASS;
657 static const char* Typename() {
658 return "VkRenderPass";
659 }
660 };
661 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeRenderPass> {
662 typedef VkRenderPass Type;
663 };
664 template <> struct VkHandleInfo<VkSampler> {
665 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeSampler;
666 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT;
667 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_SAMPLER;
668 static const char* Typename() {
669 return "VkSampler";
670 }
671 };
672 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeSampler> {
673 typedef VkSampler Type;
674 };
675 template <> struct VkHandleInfo<VkSamplerYcbcrConversion> {
676 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeSamplerYcbcrConversion;
677 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT;
678 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION;
679 static const char* Typename() {
680 return "VkSamplerYcbcrConversion";
681 }
682 };
683 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeSamplerYcbcrConversion> {
684 typedef VkSamplerYcbcrConversion Type;
685 };
686 template <> struct VkHandleInfo<VkSemaphore> {
687 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeSemaphore;
688 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT;
689 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_SEMAPHORE;
690 static const char* Typename() {
691 return "VkSemaphore";
692 }
693 };
694 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeSemaphore> {
695 typedef VkSemaphore Type;
696 };
697 template <> struct VkHandleInfo<VkShaderModule> {
698 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeShaderModule;
699 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT;
700 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_SHADER_MODULE;
701 static const char* Typename() {
702 return "VkShaderModule";
703 }
704 };
705 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeShaderModule> {
706 typedef VkShaderModule Type;
707 };
708 template <> struct VkHandleInfo<VkSurfaceKHR> {
709 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeSurfaceKHR;
710 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT;
711 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_SURFACE_KHR;
712 static const char* Typename() {
713 return "VkSurfaceKHR";
714 }
715 };
716 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeSurfaceKHR> {
717 typedef VkSurfaceKHR Type;
718 };
719 template <> struct VkHandleInfo<VkSwapchainKHR> {
720 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeSwapchainKHR;
721 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT;
722 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_SWAPCHAIN_KHR;
723 static const char* Typename() {
724 return "VkSwapchainKHR";
725 }
726 };
727 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeSwapchainKHR> {
728 typedef VkSwapchainKHR Type;
729 };
730 template <> struct VkHandleInfo<VkValidationCacheEXT> {
731 static const VulkanObjectType kVulkanObjectType = kVulkanObjectTypeValidationCacheEXT;
732 static const VkDebugReportObjectTypeEXT kDebugReportObjectType = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT;
733 static const VkObjectType kVkObjectType = VK_OBJECT_TYPE_VALIDATION_CACHE_EXT;
734 static const char* Typename() {
735 return "VkValidationCacheEXT";
736 }
737 };
738 template <> struct VulkanObjectTypeInfo<kVulkanObjectTypeValidationCacheEXT> {
739 typedef VkValidationCacheEXT Type;
740 };
741 #endif // TYPESAFE_NONDISPATCHABLE_HANDLES
742 struct VulkanTypedHandle {
743 uint64_t handle;
744 VulkanObjectType type;
745 template <typename Handle>
746 VulkanTypedHandle(Handle handle_, VulkanObjectType type_) :
747 handle(CastToUint64(handle_)),
748 type(type_) {
749 #ifdef TYPESAFE_NONDISPATCHABLE_HANDLES
750 // For 32 bit it's not always safe to check for traits <-> type
751 // as all non-dispatchable handles have the same type-id and thus traits,
752 // but on 64 bit we can validate the passed type matches the passed handle
753 assert(type == VkHandleInfo<Handle>::kVulkanObjectType);
754 #endif // TYPESAFE_NONDISPATCHABLE_HANDLES
755 }
756 template <typename Handle>
757 Handle Cast() const {
758 #ifdef TYPESAFE_NONDISPATCHABLE_HANDLES
759 assert(type == VkHandleInfo<Handle>::kVulkanObjectType);
760 #endif // TYPESAFE_NONDISPATCHABLE_HANDLES
761 return CastFromUint64<Handle>(handle);
762 }
763 VulkanTypedHandle() :
764 handle(VK_NULL_HANDLE),
765 type(kVulkanObjectTypeUnknown) {}
766 };
767
768