docs(vulkan): clarify safety contract for DeviceShared::set_object_name (#8055)

* docs(vulkan): clarify safety contract for `DeviceShared::set_object_name`
This commit is contained in:
Erich Gubler 2025-08-20 11:22:35 -04:00 committed by GitHub
parent 9aaed2c0cc
commit 57d89b4a4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,7 +27,17 @@ impl super::DeviceShared {
///
/// # Safety
///
/// It must be valid to set `object`'s debug name
/// This method inherits the safety contract from [`vkSetDebugUtilsObjectName`]. In particular:
///
/// - `object` must be a valid handle for one of the following:
/// - An instance-level object from the same instance as this device.
/// - A physical-device-level object that descends from the same physical device as this
/// device.
/// - A device-level object that descends from this device.
/// - `object` must be externally synchronized—only the calling thread should access it during
/// this call.
///
/// [`vkSetDebugUtilsObjectName`]: https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectNameEXT.html
pub(super) unsafe fn set_object_name(&self, object: impl vk::Handle, name: &str) {
let Some(extension) = self.extension_fns.debug_utils.as_ref() else {
return;