1e5c31af7Sopenharmony_ci// Copyright 2015-2024 The Khronos Group Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ci[[debugging]]
6e5c31af7Sopenharmony_ci= Debugging
7e5c31af7Sopenharmony_ci
8e5c31af7Sopenharmony_ciTo aid developers in tracking down errors in the application's use of
9e5c31af7Sopenharmony_ciVulkan, particularly in combination with an external debugger or profiler,
10e5c31af7Sopenharmony_ci_debugging extensions_ may be available.
11e5c31af7Sopenharmony_ci
12e5c31af7Sopenharmony_ci[open,refpage='VkObjectType',desc='Specify an enumeration to track object handle types',type='enums']
13e5c31af7Sopenharmony_ci--
14e5c31af7Sopenharmony_ciThe elink:VkObjectType enumeration defines values, each of which corresponds
15e5c31af7Sopenharmony_cito a specific Vulkan handle type.
16e5c31af7Sopenharmony_ciThese values can: be used to associate debug information with a particular
17e5c31af7Sopenharmony_citype of object through one or more extensions.
18e5c31af7Sopenharmony_ci
19e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkObjectType.adoc[]
20e5c31af7Sopenharmony_ci
21e5c31af7Sopenharmony_ci[[debugging-object-types]]
22e5c31af7Sopenharmony_ci.`VkObjectType` and Vulkan Handle Relationship
23e5c31af7Sopenharmony_ci[width="80%",cols="<35,<23",options="header"]
24e5c31af7Sopenharmony_ci|====
25e5c31af7Sopenharmony_ci| elink:VkObjectType                         | Vulkan Handle Type
26e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_UNKNOWN               | Unknown/Undefined Handle
27e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_INSTANCE              | slink:VkInstance
28e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PHYSICAL_DEVICE       | slink:VkPhysicalDevice
29e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DEVICE                | slink:VkDevice
30e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_QUEUE                 | slink:VkQueue
31e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SEMAPHORE             | slink:VkSemaphore
32e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_COMMAND_BUFFER        | slink:VkCommandBuffer
33e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_FENCE                 | slink:VkFence
34e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DEVICE_MEMORY         | slink:VkDeviceMemory
35e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_BUFFER                | slink:VkBuffer
36e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_IMAGE                 | slink:VkImage
37e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_EVENT                 | slink:VkEvent
38e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_QUERY_POOL            | slink:VkQueryPool
39e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_BUFFER_VIEW           | slink:VkBufferView
40e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_IMAGE_VIEW            | slink:VkImageView
41e5c31af7Sopenharmony_ciifndef::VKSC_VERSION_1_0[]
42e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SHADER_MODULE         | slink:VkShaderModule
43e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[]
44e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PIPELINE_CACHE        | slink:VkPipelineCache
45e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PIPELINE_LAYOUT       | slink:VkPipelineLayout
46e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_RENDER_PASS           | slink:VkRenderPass
47e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PIPELINE              | slink:VkPipeline
48e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT | slink:VkDescriptorSetLayout
49e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SAMPLER               | slink:VkSampler
50e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DESCRIPTOR_POOL       | slink:VkDescriptorPool
51e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DESCRIPTOR_SET        | slink:VkDescriptorSet
52e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_FRAMEBUFFER           | slink:VkFramebuffer
53e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_COMMAND_POOL          | slink:VkCommandPool
54e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
55e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION | slink:VkSamplerYcbcrConversion
56e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
57e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_descriptor_update_template[]
58e5c31af7Sopenharmony_ciifndef::VKSC_VERSION_1_0[]
59e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE | slink:VkDescriptorUpdateTemplate
60e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[]
61e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_descriptor_update_template[]
62e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_EXT_private_data[]
63e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PRIVATE_DATA_SLOT | slink:VkPrivateDataSlot
64e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_EXT_private_data[]
65e5c31af7Sopenharmony_ciifdef::VK_KHR_surface[]
66e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SURFACE_KHR           | slink:VkSurfaceKHR
67e5c31af7Sopenharmony_ciendif::VK_KHR_surface[]
68e5c31af7Sopenharmony_ciifdef::VK_KHR_swapchain[]
69e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SWAPCHAIN_KHR         | slink:VkSwapchainKHR
70e5c31af7Sopenharmony_ciendif::VK_KHR_swapchain[]
71e5c31af7Sopenharmony_ciifdef::VK_KHR_display[]
72e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DISPLAY_KHR           | slink:VkDisplayKHR
73e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DISPLAY_MODE_KHR      | slink:VkDisplayModeKHR
74e5c31af7Sopenharmony_ciendif::VK_KHR_display[]
75e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report[]
76e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT | slink:VkDebugReportCallbackEXT
77e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report[]
78e5c31af7Sopenharmony_ciifdef::VK_KHR_video_queue[]
79e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_VIDEO_SESSION_KHR | slink:VkVideoSessionKHR
80e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR | slink:VkVideoSessionParametersKHR
81e5c31af7Sopenharmony_ciendif::VK_KHR_video_queue[]
82e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_utils[]
83e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT | slink:VkDebugUtilsMessengerEXT
84e5c31af7Sopenharmony_ciendif::VK_EXT_debug_utils[]
85e5c31af7Sopenharmony_ciifdef::VK_KHR_acceleration_structure[]
86e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR | slink:VkAccelerationStructureKHR
87e5c31af7Sopenharmony_ciendif::VK_KHR_acceleration_structure[]
88e5c31af7Sopenharmony_ciifdef::VK_EXT_validation_cache[]
89e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_VALIDATION_CACHE_EXT | slink:VkValidationCacheEXT
90e5c31af7Sopenharmony_ciendif::VK_EXT_validation_cache[]
91e5c31af7Sopenharmony_ciifdef::VK_NV_ray_tracing[]
92e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV | slink:VkAccelerationStructureNV
93e5c31af7Sopenharmony_ciendif::VK_NV_ray_tracing[]
94e5c31af7Sopenharmony_ciifdef::VK_INTEL_performance_query[]
95e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL | slink:VkPerformanceConfigurationINTEL
96e5c31af7Sopenharmony_ciendif::VK_INTEL_performance_query[]
97e5c31af7Sopenharmony_ciifdef::VK_KHR_deferred_host_operations[]
98e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR | slink:VkDeferredOperationKHR
99e5c31af7Sopenharmony_ciendif::VK_KHR_deferred_host_operations[]
100e5c31af7Sopenharmony_ciifdef::VK_NV_device_generated_commands[]
101e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV | slink:VkIndirectCommandsLayoutNV
102e5c31af7Sopenharmony_ciendif::VK_NV_device_generated_commands[]
103e5c31af7Sopenharmony_ciifdef::VK_FUCHSIA_buffer_collection[]
104e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA | slink:VkBufferCollectionFUCHSIA
105e5c31af7Sopenharmony_ciendif::VK_FUCHSIA_buffer_collection[]
106e5c31af7Sopenharmony_ciifdef::VK_EXT_opacity_micromap[]
107e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_MICROMAP_EXT | slink:VkMicromapEXT
108e5c31af7Sopenharmony_ciendif::VK_EXT_opacity_micromap[]
109e5c31af7Sopenharmony_ciifdef::VK_NV_optical_flow[]
110e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV | slink:VkOpticalFlowSessionNV
111e5c31af7Sopenharmony_ciendif::VK_NV_optical_flow[]
112e5c31af7Sopenharmony_ciifdef::VK_EXT_shader_object[]
113e5c31af7Sopenharmony_ci| ename:VK_OBJECT_TYPE_SHADER_EXT | slink:VkShaderEXT
114e5c31af7Sopenharmony_ciendif::VK_EXT_shader_object[]
115e5c31af7Sopenharmony_ci|====
116e5c31af7Sopenharmony_ci--
117e5c31af7Sopenharmony_ci
118e5c31af7Sopenharmony_ciIf this Specification was generated with any such extensions included, they
119e5c31af7Sopenharmony_ciwill be described in the remainder of this chapter.
120e5c31af7Sopenharmony_ci
121e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_utils[]
122e5c31af7Sopenharmony_ciinclude::{chapters}/VK_EXT_debug_utils.adoc[]
123e5c31af7Sopenharmony_ciendif::VK_EXT_debug_utils[]
124e5c31af7Sopenharmony_ci
125e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_marker[]
126e5c31af7Sopenharmony_ciinclude::{chapters}/VK_EXT_debug_marker.adoc[]
127e5c31af7Sopenharmony_ciendif::VK_EXT_debug_marker[]
128e5c31af7Sopenharmony_ci
129e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report[]
130e5c31af7Sopenharmony_ciinclude::{chapters}/VK_EXT_debug_report.adoc[]
131e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report[]
132e5c31af7Sopenharmony_ci
133e5c31af7Sopenharmony_ciifdef::VK_NV_device_diagnostic_checkpoints,VK_EXT_device_fault[]
134e5c31af7Sopenharmony_ci== Device Loss Debugging
135e5c31af7Sopenharmony_ciendif::VK_NV_device_diagnostic_checkpoints,VK_EXT_device_fault[]
136e5c31af7Sopenharmony_ci
137e5c31af7Sopenharmony_ciifdef::VK_NV_device_diagnostic_checkpoints[]
138e5c31af7Sopenharmony_ciinclude::{chapters}/VK_NV_device_diagnostic_checkpoints/device_diagnostic_checkpoints.adoc[]
139e5c31af7Sopenharmony_ciendif::VK_NV_device_diagnostic_checkpoints[]
140e5c31af7Sopenharmony_ci
141e5c31af7Sopenharmony_ciifdef::VKSC_VERSION_1_0[]
142e5c31af7Sopenharmony_ciinclude::{chapters}/fault_handling.adoc[]
143e5c31af7Sopenharmony_ciendif::VKSC_VERSION_1_0[]
144e5c31af7Sopenharmony_ci
145e5c31af7Sopenharmony_ciifdef::VK_EXT_device_fault[]
146e5c31af7Sopenharmony_ci=== Device Fault Diagnosis
147e5c31af7Sopenharmony_ci
148e5c31af7Sopenharmony_ci[open,refpage='vkGetDeviceFaultInfoEXT',desc='Reports diagnostic fault information on the specified logical device',type='protos']
149e5c31af7Sopenharmony_ci--
150e5c31af7Sopenharmony_ciTo retrieve diagnostic information about faults that may: have caused device
151e5c31af7Sopenharmony_ciloss, call:
152e5c31af7Sopenharmony_ci
153e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetDeviceFaultInfoEXT.adoc[]
154e5c31af7Sopenharmony_ci
155e5c31af7Sopenharmony_ci  * pname:device is the logical device from which to query the diagnostic
156e5c31af7Sopenharmony_ci    fault information.
157e5c31af7Sopenharmony_ci  * pname:pFaultCounts is a pointer to a slink:VkDeviceFaultCountsEXT
158e5c31af7Sopenharmony_ci    structure in which counts for structures describing additional fault
159e5c31af7Sopenharmony_ci    information are returned.
160e5c31af7Sopenharmony_ci  * pname:pFaultInfo is `NULL` or a pointer to a slink:VkDeviceFaultInfoEXT
161e5c31af7Sopenharmony_ci    structure in which fault information is returned.
162e5c31af7Sopenharmony_ci
163e5c31af7Sopenharmony_ciIf pname:pFaultInfo is `NULL`, then the counts of corresponding additional
164e5c31af7Sopenharmony_cifault information structures available are returned in the
165e5c31af7Sopenharmony_cipname:addressInfoCount and pname:vendorInfoCount members of
166e5c31af7Sopenharmony_cipname:pFaultCounts.
167e5c31af7Sopenharmony_ciAdditionally, the size of any vendor-specific binary crash dump is returned
168e5c31af7Sopenharmony_ciin the pname:vendorBinarySize member of pname:pFaultCounts.
169e5c31af7Sopenharmony_ci
170e5c31af7Sopenharmony_ciIf pname:pFaultInfo is not `NULL`, pname:pFaultCounts must: point to a
171e5c31af7Sopenharmony_cislink:VkDeviceFaultCountsEXT structure with each structure count or size
172e5c31af7Sopenharmony_cimember (pname:addressInfoCount, pname:vendorInfoCount,
173e5c31af7Sopenharmony_cipname:vendorBinarySize) set by the user to the number of elements in the
174e5c31af7Sopenharmony_cicorresponding output array member of pname:pFaultInfo (pname:pAddressInfos
175e5c31af7Sopenharmony_ciand pname:pVendorInfos), or to the size of the output buffer in bytes
176e5c31af7Sopenharmony_ci(pname:pVendorBinaryData).
177e5c31af7Sopenharmony_ciOn return, each structure count member is overwritten with the number of
178e5c31af7Sopenharmony_cistructures actually written to the corresponding output array member of
179e5c31af7Sopenharmony_cipname:pFaultInfo.
180e5c31af7Sopenharmony_ciSimilarly, pname:vendorBinarySize is overwritten with the number of bytes
181e5c31af7Sopenharmony_ciactually written to the pname:pVendorBinaryData member of pname:pFaultInfo.
182e5c31af7Sopenharmony_ci
183e5c31af7Sopenharmony_ciIf the <<features-deviceFaultVendorBinary, vendor-specific crash dumps>>
184e5c31af7Sopenharmony_cifeature is not enabled, then implementations must: set
185e5c31af7Sopenharmony_cipname:pFaultCounts\->vendorBinarySize to zero and must: not modify
186e5c31af7Sopenharmony_cipname:pFaultInfo\->pVendorBinaryData.
187e5c31af7Sopenharmony_ci
188e5c31af7Sopenharmony_ciIf any pname:pFaultCounts structure count member is less than the number of
189e5c31af7Sopenharmony_cicorresponding fault properties available, at most structure count
190e5c31af7Sopenharmony_ci(pname:addressInfoCount, pname:vendorInfoCount) elements will be written to
191e5c31af7Sopenharmony_cithe associated pname:pFaultInfo output array.
192e5c31af7Sopenharmony_ciSimilarly, if pname:vendorBinarySize is less than the size in bytes of the
193e5c31af7Sopenharmony_ciavailable crash dump data, at most pname:vendorBinarySize elements will be
194e5c31af7Sopenharmony_ciwritten to pname:pVendorBinaryData.
195e5c31af7Sopenharmony_ci
196e5c31af7Sopenharmony_ciIf pname:pFaultInfo is `NULL`, then subsequent calls to
197e5c31af7Sopenharmony_ciflink:vkGetDeviceFaultInfoEXT for the same pname:device must: return
198e5c31af7Sopenharmony_ciidentical values in the pname:addressInfoCount, pname:vendorInfoCount and
199e5c31af7Sopenharmony_cipname:vendorBinarySize members of pname:pFaultCounts.
200e5c31af7Sopenharmony_ci
201e5c31af7Sopenharmony_ciIf pname:pFaultInfo is not `NULL`, then subsequent calls to
202e5c31af7Sopenharmony_ciflink:vkGetDeviceFaultInfoEXT for the same pname:device must: return
203e5c31af7Sopenharmony_ciidentical values in the output members of pname:pFaultInfo
204e5c31af7Sopenharmony_ci(pname:pAddressInfos, pname:pVendorInfos, pname:pVendorBinaryData), up to
205e5c31af7Sopenharmony_cithe limits described by the structure count and buffer size members of
206e5c31af7Sopenharmony_cipname:pFaultCounts (pname:addressInfoCount, pname:vendorInfoCount,
207e5c31af7Sopenharmony_cipname:vendorBinarySize).
208e5c31af7Sopenharmony_ciIf the sizes of the output members of pname:pFaultInfo increase for a
209e5c31af7Sopenharmony_cisubsequent call to flink:vkGetDeviceFaultInfoEXT, then supplementary
210e5c31af7Sopenharmony_ciinformation may: be returned in the additional available space.
211e5c31af7Sopenharmony_ci
212e5c31af7Sopenharmony_ciIf any pname:pFaultCounts structure count member is smaller than the number
213e5c31af7Sopenharmony_ciof corresponding fault properties available, or if
214e5c31af7Sopenharmony_cipname:pFaultCounts\->vendorBinarySize is smaller than the size in bytes of
215e5c31af7Sopenharmony_cithe generated binary crash dump data, ename:VK_INCOMPLETE will be returned
216e5c31af7Sopenharmony_ciinstead of ename:VK_SUCCESS, to indicate that not all the available
217e5c31af7Sopenharmony_ciproperties were returned.
218e5c31af7Sopenharmony_ci
219e5c31af7Sopenharmony_ciIf pname:pFaultCounts\->vendorBinarySize is less than what is necessary to
220e5c31af7Sopenharmony_cistore the <<vendor-binary-crash-dumps, binary crash dump header>>, nothing
221e5c31af7Sopenharmony_ciwill be written to pname:pFaultInfo\->pVendorBinaryData and zero will be
222e5c31af7Sopenharmony_ciwritten to pname:pFaultCounts\->vendorBinarySize.
223e5c31af7Sopenharmony_ci
224e5c31af7Sopenharmony_ci.Valid Usage
225e5c31af7Sopenharmony_ci****
226e5c31af7Sopenharmony_ci  * [[VUID-vkGetDeviceFaultInfoEXT-device-07336]]
227e5c31af7Sopenharmony_ci    pname:device must: be in the _lost_ state
228e5c31af7Sopenharmony_ci  * [[VUID-vkGetDeviceFaultInfoEXT-pFaultCounts-07337]]
229e5c31af7Sopenharmony_ci    If the value referenced by pname:pFaultCounts->addressInfoCount is not
230e5c31af7Sopenharmony_ci    `0`, and pname:pFaultInfo->pAddressInfos is not `NULL`,
231e5c31af7Sopenharmony_ci    pname:pFaultInfo->pAddressInfos must: be a valid pointer to an array of
232e5c31af7Sopenharmony_ci    pname:pFaultCounts->addressInfoCount slink:VkDeviceFaultAddressInfoEXT
233e5c31af7Sopenharmony_ci    structures
234e5c31af7Sopenharmony_ci  * [[VUID-vkGetDeviceFaultInfoEXT-pFaultCounts-07338]]
235e5c31af7Sopenharmony_ci    If the value referenced by pname:pFaultCounts->vendorInfoCount is not
236e5c31af7Sopenharmony_ci    `0`, and pname:pFaultInfo->pVendorInfos is not `NULL`,
237e5c31af7Sopenharmony_ci    pname:pFaultInfo->pVendorInfos must: be a valid pointer to an array of
238e5c31af7Sopenharmony_ci    pname:pFaultCounts->vendorInfoCount slink:VkDeviceFaultVendorInfoEXT
239e5c31af7Sopenharmony_ci    structures
240e5c31af7Sopenharmony_ci  * [[VUID-vkGetDeviceFaultInfoEXT-pFaultCounts-07339]]
241e5c31af7Sopenharmony_ci    If the value referenced by pname:pFaultCounts->vendorBinarySize is not
242e5c31af7Sopenharmony_ci    `0`, and pname:pFaultInfo->pVendorBinaryData is not `NULL`,
243e5c31af7Sopenharmony_ci    pname:pFaultInfo->pVendorBinaryData must: be a valid pointer to an array
244e5c31af7Sopenharmony_ci    of pname:pFaultCounts->vendorBinarySize bytes
245e5c31af7Sopenharmony_ci****
246e5c31af7Sopenharmony_ci
247e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetDeviceFaultInfoEXT.adoc[]
248e5c31af7Sopenharmony_ci--
249e5c31af7Sopenharmony_ci
250e5c31af7Sopenharmony_ci[open,refpage='VkDeviceFaultCountsEXT',desc='Structure specifying device fault information',type='structs']
251e5c31af7Sopenharmony_ci--
252e5c31af7Sopenharmony_ciThe sname:VkDeviceFaultCountsEXT structure is defined as:
253e5c31af7Sopenharmony_ci
254e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceFaultCountsEXT.adoc[]
255e5c31af7Sopenharmony_ci
256e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
257e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
258e5c31af7Sopenharmony_ci    structure.
259e5c31af7Sopenharmony_ci  * pname:addressInfoCount is the number of
260e5c31af7Sopenharmony_ci    slink:VkDeviceFaultAddressInfoEXT structures describing either memory
261e5c31af7Sopenharmony_ci    accesses which may: have caused a page fault, or the addresses of active
262e5c31af7Sopenharmony_ci    instructions at the time of the fault.
263e5c31af7Sopenharmony_ci  * pname:vendorInfoCount is the number of slink:VkDeviceFaultVendorInfoEXT
264e5c31af7Sopenharmony_ci    structures describing vendor-specific fault information.
265e5c31af7Sopenharmony_ci  * pname:vendorBinarySize is the size in bytes of a vendor-specific binary
266e5c31af7Sopenharmony_ci    crash dump, which may provide additional information when imported into
267e5c31af7Sopenharmony_ci    external tools.
268e5c31af7Sopenharmony_ci
269e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceFaultCountsEXT.adoc[]
270e5c31af7Sopenharmony_ci--
271e5c31af7Sopenharmony_ci
272e5c31af7Sopenharmony_ci[open,refpage='VkDeviceFaultInfoEXT',desc='Structure specifying device fault information',type='structs']
273e5c31af7Sopenharmony_ci--
274e5c31af7Sopenharmony_ciThe sname:VkDeviceFaultInfoEXT structure is defined as:
275e5c31af7Sopenharmony_ci
276e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceFaultInfoEXT.adoc[]
277e5c31af7Sopenharmony_ci
278e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
279e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
280e5c31af7Sopenharmony_ci    structure.
281e5c31af7Sopenharmony_ci  * pname:description is an array of ename:VK_MAX_DESCRIPTION_SIZE code:char
282e5c31af7Sopenharmony_ci    containing a null-terminated UTF-8 string which is a human readable
283e5c31af7Sopenharmony_ci    description of the fault.
284e5c31af7Sopenharmony_ci  * pname:pAddressInfos is `NULL` or a pointer to an array of
285e5c31af7Sopenharmony_ci    slink:VkDeviceFaultAddressInfoEXT structures describing either memory
286e5c31af7Sopenharmony_ci    accesses which may: have caused a page fault, or describing active
287e5c31af7Sopenharmony_ci    instruction pointers at the time of the fault.
288e5c31af7Sopenharmony_ci    If not `NULL`, each element of pname:pAddressInfos describes the a
289e5c31af7Sopenharmony_ci    bounded region of GPU virtual address space containing either the GPU
290e5c31af7Sopenharmony_ci    virtual address accessed, or the value of an active instruction pointer.
291e5c31af7Sopenharmony_ci  * pname:pVendorInfos is `NULL` or a pointer to an array of
292e5c31af7Sopenharmony_ci    slink:VkDeviceFaultVendorInfoEXT structures describing vendor-specific
293e5c31af7Sopenharmony_ci    fault information.
294e5c31af7Sopenharmony_ci  * pname:pVendorBinaryData is `NULL` or a pointer to pname:vendorBinarySize
295e5c31af7Sopenharmony_ci    number of bytes of data, which will be populated with a vendor-specific
296e5c31af7Sopenharmony_ci    binary crash dump, as described in <<vendor-binary-crash-dumps, Vendor
297e5c31af7Sopenharmony_ci    Binary Crash Dumps>>.
298e5c31af7Sopenharmony_ci
299e5c31af7Sopenharmony_ciAn implementation should: populate as many members of
300e5c31af7Sopenharmony_cislink:VkDeviceFaultInfoEXT as possible, given the information available at
301e5c31af7Sopenharmony_cithe time of the fault and the constraints of the implementation itself.
302e5c31af7Sopenharmony_ci
303e5c31af7Sopenharmony_ciDue to hardware limitations, pname:pAddressInfos describes ranges of GPU
304e5c31af7Sopenharmony_civirtual address space, rather than precise addresses.
305e5c31af7Sopenharmony_ciThe precise memory address accessed or the precise value of the instruction
306e5c31af7Sopenharmony_cipointer must: lie within the region described.
307e5c31af7Sopenharmony_ci
308e5c31af7Sopenharmony_ciifdef::VK_EXT_device_address_binding_report[]
309e5c31af7Sopenharmony_ci[NOTE]
310e5c31af7Sopenharmony_ci.Note
311e5c31af7Sopenharmony_ci====
312e5c31af7Sopenharmony_ciEach element of pname:pAddressInfos describes either:
313e5c31af7Sopenharmony_ci
314e5c31af7Sopenharmony_ci  * A memory access which may have triggered a page fault and may have
315e5c31af7Sopenharmony_ci    contributed to device loss
316e5c31af7Sopenharmony_ci  * The value of an active instruction pointer at the time a fault occurred.
317e5c31af7Sopenharmony_ci    This value may be indicative of the active pipeline or shader at the
318e5c31af7Sopenharmony_ci    time of device loss
319e5c31af7Sopenharmony_ci
320e5c31af7Sopenharmony_ciComparison of the GPU virtual addresses described by pname:pAddressInfos to
321e5c31af7Sopenharmony_ciGPU virtual address ranges reported by the
322e5c31af7Sopenharmony_ci`apiext:VK_EXT_device_address_binding_report` extension may allow
323e5c31af7Sopenharmony_ciapplications to correlate between these addresses and Vulkan objects.
324e5c31af7Sopenharmony_ciApplications should be aware that these addresses may also correspond to
325e5c31af7Sopenharmony_ciresources internal to an implementation, which will not be reported via the
326e5c31af7Sopenharmony_ci`apiext:VK_EXT_device_address_binding_report` extension.
327e5c31af7Sopenharmony_ci====
328e5c31af7Sopenharmony_ciendif::VK_EXT_device_address_binding_report[]
329e5c31af7Sopenharmony_ci
330e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceFaultInfoEXT.adoc[]
331e5c31af7Sopenharmony_ci--
332e5c31af7Sopenharmony_ci
333e5c31af7Sopenharmony_ci[open,refpage='VkDeviceFaultAddressInfoEXT',desc='Structure specifying GPU virtual address information',type='structs']
334e5c31af7Sopenharmony_ci--
335e5c31af7Sopenharmony_ciThe sname:VkDeviceFaultAddressInfoEXT structure is defined as:
336e5c31af7Sopenharmony_ci
337e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceFaultAddressInfoEXT.adoc[]
338e5c31af7Sopenharmony_ci
339e5c31af7Sopenharmony_ci  * pname:addressType is either the type of memory operation that triggered
340e5c31af7Sopenharmony_ci    a page fault, or the type of association between an instruction pointer
341e5c31af7Sopenharmony_ci    and a fault.
342e5c31af7Sopenharmony_ci  * pname:reportedAddress is the GPU virtual address recorded by the device.
343e5c31af7Sopenharmony_ci  * pname:addressPrecision is a power of two value that specifies how
344e5c31af7Sopenharmony_ci    precisely the device can report the address.
345e5c31af7Sopenharmony_ci
346e5c31af7Sopenharmony_ciThe combination of pname:reportedAddress and pname:addressPrecision allow
347e5c31af7Sopenharmony_cithe possible range of addresses to be calculated, such that:
348e5c31af7Sopenharmony_ci
349e5c31af7Sopenharmony_ci[source,c++]
350e5c31af7Sopenharmony_ci----
351e5c31af7Sopenharmony_cilower_address = (pInfo->reportedAddress & ~(pInfo->addressPrecision-1))
352e5c31af7Sopenharmony_ciupper_address = (pInfo->reportedAddress |  (pInfo->addressPrecision-1))
353e5c31af7Sopenharmony_ci----
354e5c31af7Sopenharmony_ci
355e5c31af7Sopenharmony_ci[NOTE]
356e5c31af7Sopenharmony_ci.Note
357e5c31af7Sopenharmony_ci====
358e5c31af7Sopenharmony_ciIt is valid for the pname:reportedAddress to contain a more precise address
359e5c31af7Sopenharmony_cithan indicated by pname:addressPrecision.
360e5c31af7Sopenharmony_ciIn this case, the value of pname:reportedAddress should be treated as an
361e5c31af7Sopenharmony_ciadditional hint as to the value of the address that triggered the page
362e5c31af7Sopenharmony_cifault, or to the value of an instruction pointer.
363e5c31af7Sopenharmony_ci====
364e5c31af7Sopenharmony_ci
365e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceFaultAddressInfoEXT.adoc[]
366e5c31af7Sopenharmony_ci--
367e5c31af7Sopenharmony_ci
368e5c31af7Sopenharmony_ci[open,refpage='VkDeviceFaultAddressTypeEXT',desc='Page fault access types',type='enums']
369e5c31af7Sopenharmony_ci--
370e5c31af7Sopenharmony_ciPossible values of slink:VkDeviceFaultAddressInfoEXT::pname:addressType are:
371e5c31af7Sopenharmony_ci
372e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkDeviceFaultAddressTypeEXT.adoc[]
373e5c31af7Sopenharmony_ci
374e5c31af7Sopenharmony_ci  * ename:VK_DEVICE_FAULT_ADDRESS_TYPE_NONE_EXT specifies that
375e5c31af7Sopenharmony_ci    slink:VkDeviceFaultAddressInfoEXT does not describe a page fault, or an
376e5c31af7Sopenharmony_ci    instruction address.
377e5c31af7Sopenharmony_ci  * ename:VK_DEVICE_FAULT_ADDRESS_TYPE_READ_INVALID_EXT specifies that
378e5c31af7Sopenharmony_ci    slink:VkDeviceFaultAddressInfoEXT describes a page fault triggered by an
379e5c31af7Sopenharmony_ci    invalid read operation.
380e5c31af7Sopenharmony_ci  * ename:VK_DEVICE_FAULT_ADDRESS_TYPE_WRITE_INVALID_EXT specifies that
381e5c31af7Sopenharmony_ci    slink:VkDeviceFaultAddressInfoEXT describes a page fault triggered by an
382e5c31af7Sopenharmony_ci    invalid write operation.
383e5c31af7Sopenharmony_ci  * ename:VK_DEVICE_FAULT_ADDRESS_TYPE_EXECUTE_INVALID_EXT describes a page
384e5c31af7Sopenharmony_ci    fault triggered by an attempt to execute non-executable memory.
385e5c31af7Sopenharmony_ci  * ename:VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_UNKNOWN_EXT
386e5c31af7Sopenharmony_ci    specifies an instruction pointer value at the time the fault occurred.
387e5c31af7Sopenharmony_ci    This may or may not be related to a fault.
388e5c31af7Sopenharmony_ci  * ename:VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_INVALID_EXT
389e5c31af7Sopenharmony_ci    specifies an instruction pointer value associated with an invalid
390e5c31af7Sopenharmony_ci    instruction fault.
391e5c31af7Sopenharmony_ci  * ename:VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_FAULT_EXT
392e5c31af7Sopenharmony_ci    specifies an instruction pointer value associated with a fault.
393e5c31af7Sopenharmony_ci
394e5c31af7Sopenharmony_ci[NOTE]
395e5c31af7Sopenharmony_ci.Note
396e5c31af7Sopenharmony_ci====
397e5c31af7Sopenharmony_ciThe instruction pointer values recorded may not identify the specific
398e5c31af7Sopenharmony_ciinstruction(s) that triggered the fault.
399e5c31af7Sopenharmony_ciThe relationship between the instruction pointer reported and triggering
400e5c31af7Sopenharmony_ciinstruction will be vendor-specific.
401e5c31af7Sopenharmony_ci====
402e5c31af7Sopenharmony_ci--
403e5c31af7Sopenharmony_ci
404e5c31af7Sopenharmony_ci[open,refpage='VkDeviceFaultVendorInfoEXT',desc='Structure specifying vendor-specific fault information',type='structs']
405e5c31af7Sopenharmony_ci--
406e5c31af7Sopenharmony_ciThe sname:VkDeviceFaultVendorInfoEXT structure is defined as:
407e5c31af7Sopenharmony_ci
408e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceFaultVendorInfoEXT.adoc[]
409e5c31af7Sopenharmony_ci
410e5c31af7Sopenharmony_ci  * pname:description is an array of ename:VK_MAX_DESCRIPTION_SIZE code:char
411e5c31af7Sopenharmony_ci    containing a null-terminated UTF-8 string which is a human readable
412e5c31af7Sopenharmony_ci    description of the fault.
413e5c31af7Sopenharmony_ci  * pname:vendorFaultCode is the vendor-specific fault code for this fault.
414e5c31af7Sopenharmony_ci  * pname:vendorFaultData is the vendor-specific fault data associated with
415e5c31af7Sopenharmony_ci    this fault.
416e5c31af7Sopenharmony_ci
417e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceFaultVendorInfoEXT.adoc[]
418e5c31af7Sopenharmony_ci--
419e5c31af7Sopenharmony_ci
420e5c31af7Sopenharmony_ci
421e5c31af7Sopenharmony_ci[[vendor-binary-crash-dumps]]
422e5c31af7Sopenharmony_ci==== Vendor Binary Crash Dumps
423e5c31af7Sopenharmony_ci
424e5c31af7Sopenharmony_ciApplications can: store the vendor-specific binary crash dump data retrieved
425e5c31af7Sopenharmony_ciby calling flink:vkGetDeviceFaultInfoEXT for later analysis using external
426e5c31af7Sopenharmony_citools.
427e5c31af7Sopenharmony_ci
428e5c31af7Sopenharmony_ciHowever, the format of this data may: depend on the vendor ID, device ID,
429e5c31af7Sopenharmony_cidriver version, and other details of the device.
430e5c31af7Sopenharmony_ciTo enable external applications to identify the original device from which a
431e5c31af7Sopenharmony_cicrash dump was generated, the initial bytes written to
432e5c31af7Sopenharmony_cisname:VkDeviceFaultInfoEXT::pname:pVendorBinaryData must: begin with a valid
433e5c31af7Sopenharmony_cicrash dump header.
434e5c31af7Sopenharmony_ci
435e5c31af7Sopenharmony_ci[open,refpage='VkDeviceFaultVendorBinaryHeaderVersionOneEXT',desc='Structure describing the layout of the vendor binary crash dump header',type='structs']
436e5c31af7Sopenharmony_ci--
437e5c31af7Sopenharmony_ciVersion one of the crash dump header is defined as:
438e5c31af7Sopenharmony_ci
439e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceFaultVendorBinaryHeaderVersionOneEXT.adoc[]
440e5c31af7Sopenharmony_ci
441e5c31af7Sopenharmony_ci  * pname:headerSize is the length in bytes of the crash dump header.
442e5c31af7Sopenharmony_ci  * pname:headerVersion is a elink:VkDeviceFaultVendorBinaryHeaderVersionEXT
443e5c31af7Sopenharmony_ci    enum value specifying the version of the header.
444e5c31af7Sopenharmony_ci    A consumer of the crash dump should: use the header version to interpret
445e5c31af7Sopenharmony_ci    the remainder of the header.
446e5c31af7Sopenharmony_ci  * pname:vendorID is the sname:VkPhysicalDeviceProperties::pname:vendorID
447e5c31af7Sopenharmony_ci    of the implementation.
448e5c31af7Sopenharmony_ci  * pname:deviceID is the sname:VkPhysicalDeviceProperties::pname:deviceID
449e5c31af7Sopenharmony_ci    of the implementation.
450e5c31af7Sopenharmony_ci  * pname:driverVersion is the
451e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceProperties::pname:driverVersion of the
452e5c31af7Sopenharmony_ci    implementation.
453e5c31af7Sopenharmony_ci  * pname:pipelineCacheUUID is an array of ename:VK_UUID_SIZE code:uint8_t
454e5c31af7Sopenharmony_ci    values matching the
455e5c31af7Sopenharmony_ci    sname:VkPhysicalDeviceProperties::pname:pipelineCacheUUID property of
456e5c31af7Sopenharmony_ci    the implementation.
457e5c31af7Sopenharmony_ci  * pname:applicationNameOffset is zero, or an offset from the base address
458e5c31af7Sopenharmony_ci    of the crash dump header to a null-terminated UTF-8 string containing
459e5c31af7Sopenharmony_ci    the name of the application.
460e5c31af7Sopenharmony_ci    If pname:applicationNameOffset is non-zero, this string must: match the
461e5c31af7Sopenharmony_ci    application name specified via
462e5c31af7Sopenharmony_ci    slink:VkApplicationInfo::pname:pApplicationName during instance
463e5c31af7Sopenharmony_ci    creation.
464e5c31af7Sopenharmony_ci  * pname:applicationVersion must: be zero or the value specified by
465e5c31af7Sopenharmony_ci    slink:VkApplicationInfo::pname:applicationVersion during instance
466e5c31af7Sopenharmony_ci    creation.
467e5c31af7Sopenharmony_ci  * pname:engineNameOffset is zero, or an offset from the base address of
468e5c31af7Sopenharmony_ci    the crash dump header to a null-terminated UTF-8 string containing the
469e5c31af7Sopenharmony_ci    name of the engine (if any) used to create the application.
470e5c31af7Sopenharmony_ci    If pname:engineNameOffset is non-zero, this string must: match the
471e5c31af7Sopenharmony_ci    engine name specified via slink:VkApplicationInfo::pname:pEngineName
472e5c31af7Sopenharmony_ci    during instance creation.
473e5c31af7Sopenharmony_ci  * pname:engineVersion must: be zero or the value specified by
474e5c31af7Sopenharmony_ci    slink:VkApplicationInfo::pname:engineVersion during instance creation.
475e5c31af7Sopenharmony_ci  * pname:apiVersion must: be zero or the value specified by
476e5c31af7Sopenharmony_ci    slink:VkApplicationInfo::pname:apiVersion during instance creation.
477e5c31af7Sopenharmony_ci
478e5c31af7Sopenharmony_ciUnlike most structures declared by the Vulkan API, all fields of this
479e5c31af7Sopenharmony_cistructure are written with the least significant byte first, regardless of
480e5c31af7Sopenharmony_cihost byte-order.
481e5c31af7Sopenharmony_ci
482e5c31af7Sopenharmony_ciThe C language specification does not define the packing of structure
483e5c31af7Sopenharmony_cimembers.
484e5c31af7Sopenharmony_ciThis layout assumes tight structure member packing, with members laid out in
485e5c31af7Sopenharmony_cithe order listed in the structure, and the intended size of the structure is
486e5c31af7Sopenharmony_ci56 bytes.
487e5c31af7Sopenharmony_ciIf a compiler produces code that diverges from that pattern, applications
488e5c31af7Sopenharmony_cimust: employ another method to set values at the correct offsets.
489e5c31af7Sopenharmony_ci
490e5c31af7Sopenharmony_ci.Valid Usage
491e5c31af7Sopenharmony_ci****
492e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceFaultVendorBinaryHeaderVersionOneEXT-headerSize-07340]]
493e5c31af7Sopenharmony_ci    pname:headerSize must: be 56
494e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceFaultVendorBinaryHeaderVersionOneEXT-headerVersion-07341]]
495e5c31af7Sopenharmony_ci    pname:headerVersion must: be
496e5c31af7Sopenharmony_ci    ename:VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_ONE_EXT
497e5c31af7Sopenharmony_ci****
498e5c31af7Sopenharmony_ci
499e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceFaultVendorBinaryHeaderVersionOneEXT.adoc[]
500e5c31af7Sopenharmony_ci--
501e5c31af7Sopenharmony_ci
502e5c31af7Sopenharmony_ci[open,refpage='VkDeviceFaultVendorBinaryHeaderVersionEXT',desc='Encode vendor binary crash dump version',type='enums',xrefs='vkGetDeviceFaultInfoEXT']
503e5c31af7Sopenharmony_ci--
504e5c31af7Sopenharmony_ciPossible values of the pname:headerVersion value of the crash dump header
505e5c31af7Sopenharmony_ciare:
506e5c31af7Sopenharmony_ci
507e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkDeviceFaultVendorBinaryHeaderVersionEXT.adoc[]
508e5c31af7Sopenharmony_ci
509e5c31af7Sopenharmony_ci  * ename:VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_ONE_EXT specifies
510e5c31af7Sopenharmony_ci    version one of the binary crash dump header.
511e5c31af7Sopenharmony_ci--
512e5c31af7Sopenharmony_ciendif::VK_EXT_device_fault[]
513e5c31af7Sopenharmony_ci
514e5c31af7Sopenharmony_ci
515e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3,VK_EXT_tooling_info[]
516e5c31af7Sopenharmony_ci[[debugging-tooling-info]]
517e5c31af7Sopenharmony_ci== Active Tooling Information
518e5c31af7Sopenharmony_ci
519e5c31af7Sopenharmony_ci[open,refpage='vkGetPhysicalDeviceToolProperties',desc='Reports properties of tools active on the specified physical device',type='protos',alias='vkGetPhysicalDeviceToolPropertiesEXT']
520e5c31af7Sopenharmony_ci--
521e5c31af7Sopenharmony_ciInformation about tools providing debugging, profiling, or similar services,
522e5c31af7Sopenharmony_ciactive for a given physical device, can be obtained by calling:
523e5c31af7Sopenharmony_ci
524e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3[]
525e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetPhysicalDeviceToolProperties.adoc[]
526e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3[]
527e5c31af7Sopenharmony_ci
528e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_3+VK_EXT_tooling_info[or the equivalent command]
529e5c31af7Sopenharmony_ci
530e5c31af7Sopenharmony_ciifdef::VK_EXT_tooling_info[]
531e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkGetPhysicalDeviceToolPropertiesEXT.adoc[]
532e5c31af7Sopenharmony_ciendif::VK_EXT_tooling_info[]
533e5c31af7Sopenharmony_ci
534e5c31af7Sopenharmony_ci  * pname:physicalDevice is the handle to the physical device to query for
535e5c31af7Sopenharmony_ci    active tools.
536e5c31af7Sopenharmony_ci  * pname:pToolCount is a pointer to an integer describing the number of
537e5c31af7Sopenharmony_ci    tools active on pname:physicalDevice.
538e5c31af7Sopenharmony_ci  * pname:pToolProperties is either `NULL` or a pointer to an array of
539e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceToolProperties structures.
540e5c31af7Sopenharmony_ci
541e5c31af7Sopenharmony_ciIf pname:pToolProperties is `NULL`, then the number of tools currently
542e5c31af7Sopenharmony_ciactive on pname:physicalDevice is returned in pname:pToolCount.
543e5c31af7Sopenharmony_ciOtherwise, pname:pToolCount must: point to a variable set by the user to the
544e5c31af7Sopenharmony_cinumber of elements in the pname:pToolProperties array, and on return the
545e5c31af7Sopenharmony_civariable is overwritten with the number of structures actually written to
546e5c31af7Sopenharmony_cipname:pToolProperties.
547e5c31af7Sopenharmony_ciIf pname:pToolCount is less than the number of currently active tools, at
548e5c31af7Sopenharmony_cimost pname:pToolCount structures will be written.
549e5c31af7Sopenharmony_ci
550e5c31af7Sopenharmony_ciThe count and properties of active tools may: change in response to events
551e5c31af7Sopenharmony_cioutside the scope of the specification.
552e5c31af7Sopenharmony_ciAn application should: assume these properties might change at any given
553e5c31af7Sopenharmony_citime.
554e5c31af7Sopenharmony_ci
555e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkGetPhysicalDeviceToolProperties.adoc[]
556e5c31af7Sopenharmony_ci--
557e5c31af7Sopenharmony_ci
558e5c31af7Sopenharmony_ci[open,refpage='VkPhysicalDeviceToolProperties',desc='Structure providing information about an active tool',type='structs',alias='VkPhysicalDeviceToolPropertiesEXT']
559e5c31af7Sopenharmony_ci--
560e5c31af7Sopenharmony_ciThe slink:VkPhysicalDeviceToolProperties structure is defined as:
561e5c31af7Sopenharmony_ci
562e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPhysicalDeviceToolProperties.adoc[]
563e5c31af7Sopenharmony_ci
564e5c31af7Sopenharmony_ciifdef::VK_EXT_tooling_info[]
565e5c31af7Sopenharmony_cior the equivalent
566e5c31af7Sopenharmony_ci
567e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPhysicalDeviceToolPropertiesEXT.adoc[]
568e5c31af7Sopenharmony_ciendif::VK_EXT_tooling_info[]
569e5c31af7Sopenharmony_ci
570e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
571e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
572e5c31af7Sopenharmony_ci    structure.
573e5c31af7Sopenharmony_ci  * pname:name is a null-terminated UTF-8 string containing the name of the
574e5c31af7Sopenharmony_ci    tool.
575e5c31af7Sopenharmony_ci  * pname:version is a null-terminated UTF-8 string containing the version
576e5c31af7Sopenharmony_ci    of the tool.
577e5c31af7Sopenharmony_ci  * pname:purposes is a bitmask of elink:VkToolPurposeFlagBits which is
578e5c31af7Sopenharmony_ci    populated with purposes supported by the tool.
579e5c31af7Sopenharmony_ci  * pname:description is a null-terminated UTF-8 string containing a
580e5c31af7Sopenharmony_ci    description of the tool.
581e5c31af7Sopenharmony_ci  * pname:layer is a null-terminated UTF-8 string containing the name of the
582e5c31af7Sopenharmony_ci    layer implementing the tool, if the tool is implemented in a layer -
583e5c31af7Sopenharmony_ci    otherwise it may: be an empty string.
584e5c31af7Sopenharmony_ci
585e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPhysicalDeviceToolProperties.adoc[]
586e5c31af7Sopenharmony_ci--
587e5c31af7Sopenharmony_ci
588e5c31af7Sopenharmony_ci[open,refpage='VkToolPurposeFlagBits',desc='Bitmask specifying the purposes of an active tool',type='enums',alias='VkToolPurposeFlagBitsEXT']
589e5c31af7Sopenharmony_ci--
590e5c31af7Sopenharmony_ciBits which can: be set in
591e5c31af7Sopenharmony_cislink:VkPhysicalDeviceToolProperties::pname:purposes, specifying the
592e5c31af7Sopenharmony_cipurposes of an active tool, are:
593e5c31af7Sopenharmony_ci
594e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkToolPurposeFlagBits.adoc[]
595e5c31af7Sopenharmony_ci
596e5c31af7Sopenharmony_ciifdef::VK_EXT_tooling_info[]
597e5c31af7Sopenharmony_cior the equivalent
598e5c31af7Sopenharmony_ci
599e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkToolPurposeFlagBitsEXT.adoc[]
600e5c31af7Sopenharmony_ciendif::VK_EXT_tooling_info[]
601e5c31af7Sopenharmony_ci
602e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_VALIDATION_BIT specifies that the tool provides
603e5c31af7Sopenharmony_ci    validation of API usage.
604e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_PROFILING_BIT specifies that the tool provides
605e5c31af7Sopenharmony_ci    profiling of API usage.
606e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_TRACING_BIT specifies that the tool is capturing
607e5c31af7Sopenharmony_ci    data about the application's API usage, including anything from simple
608e5c31af7Sopenharmony_ci    logging to capturing data for later replay.
609e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT specifies that the tool
610e5c31af7Sopenharmony_ci    provides additional API features/extensions on top of the underlying
611e5c31af7Sopenharmony_ci    implementation.
612e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT specifies that the tool
613e5c31af7Sopenharmony_ci    modifies the API features/limits/extensions presented to the
614e5c31af7Sopenharmony_ci    application.
615e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report,VK_EXT_debug_utils[]
616e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT specifies that the tool
617e5c31af7Sopenharmony_ci    reports additional information to the application via callbacks
618e5c31af7Sopenharmony_ci    specified by
619e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report[]
620e5c31af7Sopenharmony_ci    flink:vkCreateDebugReportCallbackEXT
621e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report[]
622e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_report+VK_EXT_debug_utils[]
623e5c31af7Sopenharmony_ci    or
624e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report+VK_EXT_debug_utils[]
625e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_utils[]
626e5c31af7Sopenharmony_ci    flink:vkCreateDebugUtilsMessengerEXT
627e5c31af7Sopenharmony_ciendif::VK_EXT_debug_utils[]
628e5c31af7Sopenharmony_ciendif::VK_EXT_debug_report,VK_EXT_debug_utils[]
629e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_marker,VK_EXT_debug_utils[]
630e5c31af7Sopenharmony_ci  * ename:VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT specifies that the tool
631e5c31af7Sopenharmony_ci    consumes
632e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_marker[]
633e5c31af7Sopenharmony_ci    <<debugging-debug-markers,debug markers>>
634e5c31af7Sopenharmony_ciendif::VK_EXT_debug_marker[]
635e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_marker+VK_EXT_debug_utils[]
636e5c31af7Sopenharmony_ci    or
637e5c31af7Sopenharmony_ciendif::VK_EXT_debug_marker+VK_EXT_debug_utils[]
638e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_utils[]
639e5c31af7Sopenharmony_ci    <<debugging-object-debug-annotation,object debug annotation>>,
640e5c31af7Sopenharmony_ci    <<debugging-queue-labels, queue labels>>, or
641e5c31af7Sopenharmony_ci    <<debugging-command-buffer-labels, command buffer labels>>
642e5c31af7Sopenharmony_ciendif::VK_EXT_debug_utils[]
643e5c31af7Sopenharmony_ciendif::VK_EXT_debug_marker,VK_EXT_debug_utils[]
644e5c31af7Sopenharmony_ci--
645e5c31af7Sopenharmony_ci
646e5c31af7Sopenharmony_ci[open,refpage='VkToolPurposeFlags',desc='Bitmask of VkToolPurposeFlagBits',type='flags',alias='VkToolPurposeFlagsEXT']
647e5c31af7Sopenharmony_ci--
648e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkToolPurposeFlags.adoc[]
649e5c31af7Sopenharmony_ci
650e5c31af7Sopenharmony_ciifdef::VK_EXT_tooling_info[]
651e5c31af7Sopenharmony_cior the equivalent
652e5c31af7Sopenharmony_ci
653e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkToolPurposeFlagsEXT.adoc[]
654e5c31af7Sopenharmony_ciendif::VK_EXT_tooling_info[]
655e5c31af7Sopenharmony_ci
656e5c31af7Sopenharmony_citlink:VkToolPurposeFlags is a bitmask type for setting a mask of zero or
657e5c31af7Sopenharmony_cimore elink:VkToolPurposeFlagBits.
658e5c31af7Sopenharmony_ci--
659e5c31af7Sopenharmony_ciendif::VK_VERSION_1_3,VK_EXT_tooling_info[]
660e5c31af7Sopenharmony_ci
661e5c31af7Sopenharmony_ci
662e5c31af7Sopenharmony_ciifdef::VK_EXT_frame_boundary[]
663e5c31af7Sopenharmony_ci== Frame Boundary
664e5c31af7Sopenharmony_ci
665e5c31af7Sopenharmony_ci[open,refpage='VkFrameBoundaryEXT',desc='Add frame boundary information to queue submissions',type='structs']
666e5c31af7Sopenharmony_ci--
667e5c31af7Sopenharmony_ciThe sname:VkFrameBoundaryEXT structure is defined as:
668e5c31af7Sopenharmony_ci
669e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkFrameBoundaryEXT.adoc[]
670e5c31af7Sopenharmony_ci
671e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
672e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
673e5c31af7Sopenharmony_ci    structure.
674e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkFrameBoundaryFlagBitsEXT that can
675e5c31af7Sopenharmony_ci    flag the last submission of a frame identifier.
676e5c31af7Sopenharmony_ci  * pname:frameID is the frame identifier.
677e5c31af7Sopenharmony_ci  * pname:imageCount is the number of images that store frame results.
678e5c31af7Sopenharmony_ci  * pname:pImages is a pointer to an array of VkImage objects with
679e5c31af7Sopenharmony_ci    imageCount entries.
680e5c31af7Sopenharmony_ci  * pname:bufferCount is the number of buffers the store the frame results.
681e5c31af7Sopenharmony_ci  * pname:pBuffers is a pointer to an array of VkBuffer objects with
682e5c31af7Sopenharmony_ci    bufferCount entries.
683e5c31af7Sopenharmony_ci  * pname:tagName is a numerical identifier for tag data.
684e5c31af7Sopenharmony_ci  * pname:tagSize is the number of bytes of tag data.
685e5c31af7Sopenharmony_ci  * pname:pTag is a pointer to an array of pname:tagSize bytes containing
686e5c31af7Sopenharmony_ci    tag data.
687e5c31af7Sopenharmony_ci
688e5c31af7Sopenharmony_ciThe application can: associate frame boundary information to a queue
689e5c31af7Sopenharmony_cisubmission call by adding a sname:VkFrameBoundaryEXT structure to the
690e5c31af7Sopenharmony_cipname:pNext chain of <<devsandqueues-submission,queue submission>>,
691e5c31af7Sopenharmony_ciifdef::VK_KHR_swapchain[slink:VkPresentInfoKHR,]
692e5c31af7Sopenharmony_cior slink:VkBindSparseInfo.
693e5c31af7Sopenharmony_ci
694e5c31af7Sopenharmony_ciThe frame identifier is used to associate one or more queue submission to a
695e5c31af7Sopenharmony_ciframe, it is thus meant to be unique within a frame lifetime, i.e. it is
696e5c31af7Sopenharmony_cipossible (but not recommended) to reuse frame identifiers, as long as any
697e5c31af7Sopenharmony_citwo frames with any chance of having overlapping queue submissions (as in
698e5c31af7Sopenharmony_cithe example above) use two different frame identifiers.
699e5c31af7Sopenharmony_ci
700e5c31af7Sopenharmony_ci[NOTE]
701e5c31af7Sopenharmony_ci.Note
702e5c31af7Sopenharmony_ci====
703e5c31af7Sopenharmony_ciSince the concept of frame is application-dependent, there is no way to
704e5c31af7Sopenharmony_civalidate the use of frame identifier.
705e5c31af7Sopenharmony_ciIt is good practice to use a monotonically increasing counter as the frame
706e5c31af7Sopenharmony_ciidentifier and not reuse identifiers between frames.
707e5c31af7Sopenharmony_ci====
708e5c31af7Sopenharmony_ci
709e5c31af7Sopenharmony_ciThe pname:pImages and pname:pBuffers arrays contain a list of images and
710e5c31af7Sopenharmony_cibuffers which store the "end result" of the frame.
711e5c31af7Sopenharmony_ciAs the concept of frame is application-dependent, not all frames may:
712e5c31af7Sopenharmony_ciproduce their results in images or buffers, yet this is a sufficiently
713e5c31af7Sopenharmony_cicommon case to be handled by sname:VkFrameBoundaryEXT.
714e5c31af7Sopenharmony_ciNote that no extra information, such as image layout is being provided,
715e5c31af7Sopenharmony_cisince the images are meant to be used by tools which would already be
716e5c31af7Sopenharmony_citracking this required information.
717e5c31af7Sopenharmony_ciifdef::VK_KHR_swapchain[]
718e5c31af7Sopenharmony_ciHaving the possibility of passing a list of end-result images makes
719e5c31af7Sopenharmony_cisname:VkFrameBoundaryEXT as expressive as flink:vkQueuePresentKHR, which is
720e5c31af7Sopenharmony_cioften the default frame boundary delimiter.
721e5c31af7Sopenharmony_ciendif::VK_KHR_swapchain[]
722e5c31af7Sopenharmony_ci
723e5c31af7Sopenharmony_ciThe application can: also associate arbitrary extra information via tag data
724e5c31af7Sopenharmony_ciusing pname:tagName, pname:tagSize and pname:pTag.
725e5c31af7Sopenharmony_ciThis extra information is typically tool-specific.
726e5c31af7Sopenharmony_ci
727e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkFrameBoundaryEXT.adoc[]
728e5c31af7Sopenharmony_ci--
729e5c31af7Sopenharmony_ci
730e5c31af7Sopenharmony_ci[open,refpage='VkFrameBoundaryFlagBitsEXT',desc='Bitmask specifying whether a queue submission is the last one for a given frame',type='enums']
731e5c31af7Sopenharmony_ci--
732e5c31af7Sopenharmony_ciThe bit which can: be set in slink:VkFrameBoundaryEXT::pname:flags is:
733e5c31af7Sopenharmony_ci
734e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkFrameBoundaryFlagBitsEXT.adoc[]
735e5c31af7Sopenharmony_ci
736e5c31af7Sopenharmony_ci  * ename:VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT specifies that this queue
737e5c31af7Sopenharmony_ci    submission is the last one for this frame, i.e. once this queue
738e5c31af7Sopenharmony_ci    submission has terminated, then the work for this frame is completed.
739e5c31af7Sopenharmony_ci--
740e5c31af7Sopenharmony_ci
741e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
742e5c31af7Sopenharmony_ciNote that in the presence of timeline semaphores, the last queue submission
743e5c31af7Sopenharmony_cimight not be the last one to be submitted, as timeline semaphores allow for
744e5c31af7Sopenharmony_ciwait-before-signal submissions.
745e5c31af7Sopenharmony_ciIn the context of frame boundary, the queue submission that should be done
746e5c31af7Sopenharmony_ciflagged as the last one is the one that is meant to be executed last, even
747e5c31af7Sopenharmony_ciif it may: not be the last one to be submitted.
748e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
749e5c31af7Sopenharmony_ci
750e5c31af7Sopenharmony_ci[open,refpage='VkFrameBoundaryFlagsEXT',desc='Bitmask of VkFrameBoundaryFlagBitsEXT',type='flags']
751e5c31af7Sopenharmony_ci--
752e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkFrameBoundaryFlagsEXT.adoc[]
753e5c31af7Sopenharmony_ci
754e5c31af7Sopenharmony_citlink:VkFrameBoundaryFlagsEXT is a bitmask type for setting a mask of zero
755e5c31af7Sopenharmony_cior more elink:VkFrameBoundaryFlagBitsEXT.
756e5c31af7Sopenharmony_ci--
757e5c31af7Sopenharmony_ci
758e5c31af7Sopenharmony_ciendif::VK_EXT_frame_boundary[]
759