mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 16:24:24 +00:00
Clean up render pass labels
This commit is contained in:
parent
03d2c57dc5
commit
cb67ef6542
@ -118,12 +118,14 @@ impl<B: GfxBackend> CommandAllocator<B> {
|
||||
used_swap_chain: None,
|
||||
limits,
|
||||
private_features,
|
||||
has_labels: label.is_some(),
|
||||
#[cfg(feature = "trace")]
|
||||
commands: if enable_tracing {
|
||||
Some(Vec::new())
|
||||
} else {
|
||||
None
|
||||
},
|
||||
#[cfg(debug_assertions)]
|
||||
label: label.to_string_or_default(),
|
||||
})
|
||||
}
|
||||
@ -209,7 +211,7 @@ impl<B: hal::Backend> CommandAllocator<B> {
|
||||
) {
|
||||
// Record this command buffer as pending
|
||||
let mut inner = self.inner.lock();
|
||||
let clear_label = !cmd_buf.label.is_empty();
|
||||
let clear_label = cmd_buf.has_labels;
|
||||
inner
|
||||
.pools
|
||||
.get_mut(&cmd_buf.recorded_thread_id)
|
||||
|
@ -45,8 +45,10 @@ pub struct CommandBuffer<B: hal::Backend> {
|
||||
pub(crate) used_swap_chain: Option<(Stored<id::SwapChainId>, B::Framebuffer)>,
|
||||
limits: wgt::Limits,
|
||||
private_features: PrivateFeatures,
|
||||
has_labels: bool,
|
||||
#[cfg(feature = "trace")]
|
||||
pub(crate) commands: Option<Vec<crate::device::trace::Command>>,
|
||||
#[cfg(debug_assertions)]
|
||||
pub(crate) label: String,
|
||||
}
|
||||
|
||||
|
@ -499,6 +499,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
unsafe {
|
||||
if let Some(ref label) = base.label {
|
||||
cmd_buf.has_labels = true;
|
||||
device.raw.set_command_buffer_name(&mut raw, label);
|
||||
}
|
||||
raw.begin_primary(hal::command::CommandBufferFlags::ONE_TIME_SUBMIT);
|
||||
|
Loading…
Reference in New Issue
Block a user