fix(hal/vulkan): Respect InstanceFlags::DISCARD_HAL_LABELS (#10121)

This commit is contained in:
Andy Leiserson authored and GitHub committed 2026-08-27 06:35:08 -04:00
1 parent ca76233ed9
commit 1f782a55ae
2 files changed
+17 -4

No files matched your search

+10 -3
View File
@@ -134,9 +134,16 @@ impl crate::CommandEncoder for super::CommandEncoder {
}
let raw = self.free.pop().unwrap();
// Set the name unconditionally, since there might be a
// previous name assigned to this.
unsafe { self.device.set_object_name(raw, label.unwrap_or_default()) };
if !self
.device
.instance
.flags
.contains(wgt::InstanceFlags::DISCARD_HAL_LABELS)
{
// Set the name even if it is empty, since there might be a
// previous name assigned to the command buffer.
unsafe { self.device.set_object_name(raw, label.unwrap_or_default()) };
}
// Reset some state in case the last renderpass was never ended.
self.rpass_debug_marker_active = false;
+7 -1
View File
@@ -3030,7 +3030,13 @@ impl super::DeviceShared {
.create_semaphore(&vk::SemaphoreCreateInfo::default(), None)
.map_err(super::map_host_device_oom_err)?;
self.set_object_name(semaphore, name);
if !self
.instance
.flags
.contains(wgt::InstanceFlags::DISCARD_HAL_LABELS)
{
self.set_object_name(semaphore, name);
}
Ok(semaphore)
}