mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-30 18:14:18 +01:00
fix(hal/vulkan): Respect InstanceFlags::DISCARD_HAL_LABELS (#10121)
This commit is contained in:
1 parent
ca76233ed9
commit
1f782a55ae
2 files changed
+17
-4
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user