1e5c31af7Sopenharmony_ci// Copyright 2015-2021 The Khronos Group Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ci= Debugging
6e5c31af7Sopenharmony_ci
7e5c31af7Sopenharmony_ciTo aid developers in tracking down errors in the application's use of
8e5c31af7Sopenharmony_ciVulkan, particularly in combination with an external debugger or profiler,
9e5c31af7Sopenharmony_ci_debugging extensions_ may be available.
10e5c31af7Sopenharmony_ci
11e5c31af7Sopenharmony_ci[open,refpage='VkObjectType',desc='Specify an enumeration to track object handle types',type='enums']
12e5c31af7Sopenharmony_ci--
13e5c31af7Sopenharmony_ciThe elink:VkObjectType enumeration defines values, each of which corresponds
14e5c31af7Sopenharmony_cito a specific Vulkan handle type.
15e5c31af7Sopenharmony_ciThese values can: be used to associate debug information with a particular
16e5c31af7Sopenharmony_citype of object through one or more extensions.
17e5c31af7Sopenharmony_ci
18e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkObjectType.txt[]
19e5c31af7Sopenharmony_ci
20e5c31af7Sopenharmony_ci[[debugging-object-types]]
21e5c31af7Sopenharmony_ci.`VkObjectType` and Vulkan Handle Relationship
22e5c31af7Sopenharmony_ci[width="80%",cols="<35,<23",options="header"]
23e5c31af7Sopenharmony_ci|====
24e5c31af7Sopenharmony_ci| elink:VkObjectType                         | Vulkan Handle Type
25e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_UNKNOWN               | Unknown/Undefined Handle
26e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_INSTANCE              | slink:VkInstance
27e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PHYSICAL_DEVICE       | slink:VkPhysicalDevice
28e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DEVICE                | slink:VkDevice
29e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_QUEUE                 | slink:VkQueue
30e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SEMAPHORE             | slink:VkSemaphore
31e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_COMMAND_BUFFER        | slink:VkCommandBuffer
32e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_FENCE                 | slink:VkFence
33e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DEVICE_MEMORY         | slink:VkDeviceMemory
34e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_BUFFER                | slink:VkBuffer
35e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_IMAGE                 | slink:VkImage
36e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_EVENT                 | slink:VkEvent
37e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_QUERY_POOL            | slink:VkQueryPool
38e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_BUFFER_VIEW           | slink:VkBufferView
39e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_IMAGE_VIEW            | slink:VkImageView
40e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SHADER_MODULE         | slink:VkShaderModule
41e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PIPELINE_CACHE        | slink:VkPipelineCache
42e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PIPELINE_LAYOUT       | slink:VkPipelineLayout
43e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_RENDER_PASS           | slink:VkRenderPass
44e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PIPELINE              | slink:VkPipeline
45e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT | slink:VkDescriptorSetLayout
46e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SAMPLER               | slink:VkSampler
47e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DESCRIPTOR_POOL       | slink:VkDescriptorPool
48e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DESCRIPTOR_SET        | slink:VkDescriptorSet
49e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_FRAMEBUFFER           | slink:VkFramebuffer
50e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_COMMAND_POOL          | slink:VkCommandPool
51e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
52e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION | slink:VkSamplerYcbcrConversion
53e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
54e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_descriptor_update_template[]
55e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE | slink:VkDescriptorUpdateTemplate
56e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_descriptor_update_template[]
57e5c31af7Sopenharmony_ciifdef::VK_KHR_surface[]
58e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SURFACE_KHR           | slink:VkSurfaceKHR
59e5c31af7Sopenharmony_ciendif::VK_KHR_surface[]
60e5c31af7Sopenharmony_ciifdef::VK_KHR_swapchain[]
61e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SWAPCHAIN_KHR         | slink:VkSwapchainKHR
62e5c31af7Sopenharmony_ciendif::VK_KHR_swapchain[]
63e5c31af7Sopenharmony_ciifdef::VK_KHR_display[]
64e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DISPLAY_KHR           | slink:VkDisplayKHR
65e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DISPLAY_MODE_KHR      | slink:VkDisplayModeKHR
66e5c31af7Sopenharmony_ciendif::VK_KHR_display[]
67e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report[]
68e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT | slink:VkDebugReportCallbackEXT
69e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report[]
70e5c31af7Sopenharmony_ciifdef::VK_NV_device_generated_commands[]
71e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV | slink:VkIndirectCommandsLayoutNV
72e5c31af7Sopenharmony_ciendif::VK_NV_device_generated_commands[]
73e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_utils[]
74e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT | slink:VkDebugUtilsMessengerEXT
75e5c31af7Sopenharmony_ciendif::VK_EXT_debug_utils[]
76e5c31af7Sopenharmony_ciifdef::VK_EXT_validation_cache[]
77e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_VALIDATION_CACHE_EXT | slink:VkValidationCacheEXT
78e5c31af7Sopenharmony_ciendif::VK_EXT_validation_cache[]
79e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
80e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV | slink:VkAccelerationStructureNV
81e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
82e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
83e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR | slink:VkAccelerationStructureKHR
84e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
85e5c31af7Sopenharmony_ciifdef::VK_INTEL_performance_query[]
86e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL | slink:VkPerformanceConfigurationINTEL
87e5c31af7Sopenharmony_ciendif::VK_INTEL_performance_query[]
88e5c31af7Sopenharmony_ciifdef::VK_KHR_deferred_host_operations[]
89e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR | slink:VkDeferredOperationKHR
90e5c31af7Sopenharmony_ciendif::VK_KHR_deferred_host_operations[]
91e5c31af7Sopenharmony_ciifdef::VK_EXT_private_data[]
92e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT | slink:VkPrivateDataSlotEXT
93e5c31af7Sopenharmony_ciendif::VK_EXT_private_data[]
94e5c31af7Sopenharmony_ci|====
95e5c31af7Sopenharmony_ci--
96e5c31af7Sopenharmony_ci
97e5c31af7Sopenharmony_ciIf this Specification was generated with any such extensions included, they
98e5c31af7Sopenharmony_ciwill be described in the remainder of this chapter.
99e5c31af7Sopenharmony_ci
100e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_utils[]
101e5c31af7Sopenharmony_ciinclude::{chapters}/VK_EXT_debug_utils.txt[]
102e5c31af7Sopenharmony_ciendif::VK_EXT_debug_utils[]
103e5c31af7Sopenharmony_ci
104e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_marker[]
105e5c31af7Sopenharmony_ciinclude::{chapters}/VK_EXT_debug_marker.txt[]
106e5c31af7Sopenharmony_ciendif::VK_EXT_debug_marker[]
107e5c31af7Sopenharmony_ci
108e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report[]
109e5c31af7Sopenharmony_ciinclude::{chapters}/VK_EXT_debug_report.txt[]
110e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report[]
111e5c31af7Sopenharmony_ci
112e5c31af7Sopenharmony_ciifdef::VK_NV_device_diagnostic_checkpoints[]
113e5c31af7Sopenharmony_ciinclude::{chapters}/VK_NV_device_diagnostic_checkpoints/device_diagnostic_checkpoints.txt[]
114e5c31af7Sopenharmony_ciendif::VK_NV_device_diagnostic_checkpoints[]
115e5c31af7Sopenharmony_ci
116e5c31af7Sopenharmony_ci
117e5c31af7Sopenharmony_ciifdef::VK_EXT_tooling_info[]
118e5c31af7Sopenharmony_ci[[debugging-tooling-info]]
119e5c31af7Sopenharmony_ci== Active Tooling Information
120e5c31af7Sopenharmony_ci
121e5c31af7Sopenharmony_ci[open,refpage='vkGetPhysicalDeviceToolPropertiesEXT',desc='Reports properties of tools active on the specified physical device',type='protos']
122e5c31af7Sopenharmony_ci--
123e5c31af7Sopenharmony_ciInformation about tools providing debugging, profiling, or similar services,
124e5c31af7Sopenharmony_ciactive for a given physical device, can be obtained by calling:
125e5c31af7Sopenharmony_ci
126e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetPhysicalDeviceToolPropertiesEXT.txt[]
127e5c31af7Sopenharmony_ci
128e5c31af7Sopenharmony_ci  * pname:physicalDevice is the handle to the physical device to query for
129e5c31af7Sopenharmony_ci    active tools.
130e5c31af7Sopenharmony_ci  * pname:pToolCount is a pointer to an integer describing the number of
131e5c31af7Sopenharmony_ci    tools active on pname:physicalDevice.
132e5c31af7Sopenharmony_ci  * pname:pToolProperties is either `NULL` or a pointer to an array of
133e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceToolPropertiesEXT structures.
134e5c31af7Sopenharmony_ci
135e5c31af7Sopenharmony_ciIf pname:pToolProperties is `NULL`, then the number of tools currently
136e5c31af7Sopenharmony_ciactive on pname:physicalDevice is returned in pname:pToolCount.
137e5c31af7Sopenharmony_ciOtherwise, pname:pToolCount must: point to a variable set by the user to the
138e5c31af7Sopenharmony_cinumber of elements in the pname:pToolProperties array, and on return the
139e5c31af7Sopenharmony_civariable is overwritten with the number of structures actually written to
140e5c31af7Sopenharmony_cipname:pToolProperties.
141e5c31af7Sopenharmony_ciIf pname:pToolCount is less than the number of currently active tools, at
142e5c31af7Sopenharmony_cimost pname:pToolCount structures will be written.
143e5c31af7Sopenharmony_ci
144e5c31af7Sopenharmony_ciThe count and properties of active tools may: change in response to events
145e5c31af7Sopenharmony_cioutside the scope of the specification.
146e5c31af7Sopenharmony_ciAn application should: assume these properties might change at any given
147e5c31af7Sopenharmony_citime.
148e5c31af7Sopenharmony_ci
149e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetPhysicalDeviceToolPropertiesEXT.txt[]
150e5c31af7Sopenharmony_ci--
151e5c31af7Sopenharmony_ci
152e5c31af7Sopenharmony_ci[open,refpage='VkPhysicalDeviceToolPropertiesEXT',desc='Structure providing information about an active tool',type='structs']
153e5c31af7Sopenharmony_ci--
154e5c31af7Sopenharmony_ciThe slink:VkPhysicalDeviceToolPropertiesEXT structure is defined as:
155e5c31af7Sopenharmony_ci
156e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPhysicalDeviceToolPropertiesEXT.txt[]
157e5c31af7Sopenharmony_ci
158e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
159e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
160e5c31af7Sopenharmony_ci    structure.
161e5c31af7Sopenharmony_ci  * pname:name is a null-terminated UTF-8 string containing the name of the
162e5c31af7Sopenharmony_ci    tool.
163e5c31af7Sopenharmony_ci  * pname:version is a null-terminated UTF-8 string containing the version
164e5c31af7Sopenharmony_ci    of the tool.
165e5c31af7Sopenharmony_ci  * pname:purposes is a bitmask of elink:VkToolPurposeFlagBitsEXT which is
166e5c31af7Sopenharmony_ci    populated with purposes supported by the tool.
167e5c31af7Sopenharmony_ci  * pname:description is a null-terminated UTF-8 string containing a
168e5c31af7Sopenharmony_ci    description of the tool.
169e5c31af7Sopenharmony_ci  * pname:layer is a null-terminated UTF-8 string containing the name of the
170e5c31af7Sopenharmony_ci    layer implementing the tool, if the tool is implemented in a layer -
171e5c31af7Sopenharmony_ci    otherwise it may: be an empty string.
172e5c31af7Sopenharmony_ci
173e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPhysicalDeviceToolPropertiesEXT.txt[]
174e5c31af7Sopenharmony_ci--
175e5c31af7Sopenharmony_ci
176e5c31af7Sopenharmony_ci[open,refpage='VkToolPurposeFlagBitsEXT',desc='Bitmask specifying the purposes of an active tool',type='enums']
177e5c31af7Sopenharmony_ci--
178e5c31af7Sopenharmony_ciBits which can: be set in slink:VkDeviceQueueCreateInfo::pname:purposes
179e5c31af7Sopenharmony_cispecifying the purposes of an active tool are:
180e5c31af7Sopenharmony_ci
181e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkToolPurposeFlagBitsEXT.txt[]
182e5c31af7Sopenharmony_ci
183e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_VALIDATION_BIT_EXT specifies that the tool
184e5c31af7Sopenharmony_ci    provides validation of API usage.
185e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_PROFILING_BIT_EXT specifies that the tool provides
186e5c31af7Sopenharmony_ci    profiling of API usage.
187e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_TRACING_BIT_EXT specifies that the tool is
188e5c31af7Sopenharmony_ci    capturing data about the application's API usage, including anything
189e5c31af7Sopenharmony_ci    from simple logging to capturing data for later replay.
190e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT specifies that the
191e5c31af7Sopenharmony_ci    tool provides additional API features/extensions on top of the
192e5c31af7Sopenharmony_ci    underlying implementation.
193e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT specifies that the tool
194e5c31af7Sopenharmony_ci    modifies the API features/limits/extensions presented to the
195e5c31af7Sopenharmony_ci    application.
196e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report,VK_EXT_debug_utils[]
197e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT specifies that the tool
198e5c31af7Sopenharmony_ci    reports additional information to the application via callbacks
199e5c31af7Sopenharmony_ci    specified by
200e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report[]
201e5c31af7Sopenharmony_ci    flink:vkCreateDebugReportCallbackEXT
202e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report[]
203e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report+VK_EXT_debug_utils[]
204e5c31af7Sopenharmony_ci    or
205e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report+VK_EXT_debug_utils[]
206e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_utils[]
207e5c31af7Sopenharmony_ci    flink:vkCreateDebugUtilsMessengerEXT
208e5c31af7Sopenharmony_ciendif::VK_EXT_debug_utils[]
209e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report,VK_EXT_debug_utils[]
210e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_marker,VK_EXT_debug_utils[]
211e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT specifies that the tool
212e5c31af7Sopenharmony_ci    consumes
213e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_marker[]
214e5c31af7Sopenharmony_ci    <<debugging-debug-markers,debug markers>>
215e5c31af7Sopenharmony_ciendif::VK_EXT_debug_marker[]
216e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_marker+VK_EXT_debug_utils[]
217e5c31af7Sopenharmony_ci    or
218e5c31af7Sopenharmony_ciendif::VK_EXT_debug_marker+VK_EXT_debug_utils[]
219e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_utils[]
220e5c31af7Sopenharmony_ci    <<debugging-object-debug-annotation,object debug annotation>>,
221e5c31af7Sopenharmony_ci    <<debugging-queue-labels, queue labels>>, or
222e5c31af7Sopenharmony_ci    <<debugging-command-buffer-labels, command buffer labels>>
223e5c31af7Sopenharmony_ciendif::VK_EXT_debug_utils[]
224e5c31af7Sopenharmony_ciendif::VK_EXT_debug_marker,VK_EXT_debug_utils[]
225e5c31af7Sopenharmony_ci--
226e5c31af7Sopenharmony_ci
227e5c31af7Sopenharmony_ci[open,refpage='VkToolPurposeFlagsEXT',desc='Bitmask of VkToolPurposeFlagBitsEXT',type='flags']
228e5c31af7Sopenharmony_ci--
229e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkToolPurposeFlagsEXT.txt[]
230e5c31af7Sopenharmony_ci
231e5c31af7Sopenharmony_citlink:VkToolPurposeFlagsEXT is a bitmask type for setting a mask of zero or
232e5c31af7Sopenharmony_cimore elink:VkToolPurposeFlagBitsEXT.
233e5c31af7Sopenharmony_ci--
234e5c31af7Sopenharmony_ciendif::VK_EXT_tooling_info[]
235