Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion wgpu-hal/src/vulkan/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I think this might be stricter of a requirement than actually necessary. I suspect the only requirement here is that the object in question hasn't been destroyed in the Vulkan runtime yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried summarizing the relevant parts of the Vulkan spec. with 2e1f81d, rather than a hot-take must-be-safe approach that doesn't necessarily mesh with Vulkan terminology.

///
/// - `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;
Expand Down
Loading