Skip to content

Commit 57d89b4

Browse files
docs(vulkan): clarify safety contract for DeviceShared::set_object_name (#8055)
* docs(vulkan): clarify safety contract for `DeviceShared::set_object_name`
1 parent 9aaed2c commit 57d89b4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

wgpu-hal/src/vulkan/device.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ impl super::DeviceShared {
2727
///
2828
/// # Safety
2929
///
30-
/// It must be valid to set `object`'s debug name
30+
/// This method inherits the safety contract from [`vkSetDebugUtilsObjectName`]. In particular:
31+
///
32+
/// - `object` must be a valid handle for one of the following:
33+
/// - An instance-level object from the same instance as this device.
34+
/// - A physical-device-level object that descends from the same physical device as this
35+
/// device.
36+
/// - A device-level object that descends from this device.
37+
/// - `object` must be externally synchronized—only the calling thread should access it during
38+
/// this call.
39+
///
40+
/// [`vkSetDebugUtilsObjectName`]: https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectNameEXT.html
3141
pub(super) unsafe fn set_object_name(&self, object: impl vk::Handle, name: &str) {
3242
let Some(extension) = self.extension_fns.debug_utils.as_ref() else {
3343
return;

0 commit comments

Comments
 (0)