mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
Merge #1090
1090: Clean up render pass labels r=kvark a=kvark **Connections** Follow-up to #1088 to fix https://github.com/gfx-rs/wgpu/issues/1089#issuecomment-745596393 **Description** Render passes are recorded into their own command buffers under the hood, and I forgot to properly reset the labels on them. **Testing** Untested Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
commit
42a8dc5b34
@ -118,12 +118,14 @@ impl<B: GfxBackend> CommandAllocator<B> {
|
|||||||
used_swap_chain: None,
|
used_swap_chain: None,
|
||||||
limits,
|
limits,
|
||||||
private_features,
|
private_features,
|
||||||
|
has_labels: label.is_some(),
|
||||||
#[cfg(feature = "trace")]
|
#[cfg(feature = "trace")]
|
||||||
commands: if enable_tracing {
|
commands: if enable_tracing {
|
||||||
Some(Vec::new())
|
Some(Vec::new())
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
label: label.to_string_or_default(),
|
label: label.to_string_or_default(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -209,7 +211,7 @@ impl<B: hal::Backend> CommandAllocator<B> {
|
|||||||
) {
|
) {
|
||||||
// Record this command buffer as pending
|
// Record this command buffer as pending
|
||||||
let mut inner = self.inner.lock();
|
let mut inner = self.inner.lock();
|
||||||
let clear_label = !cmd_buf.label.is_empty();
|
let clear_label = cmd_buf.has_labels;
|
||||||
inner
|
inner
|
||||||
.pools
|
.pools
|
||||||
.get_mut(&cmd_buf.recorded_thread_id)
|
.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)>,
|
pub(crate) used_swap_chain: Option<(Stored<id::SwapChainId>, B::Framebuffer)>,
|
||||||
limits: wgt::Limits,
|
limits: wgt::Limits,
|
||||||
private_features: PrivateFeatures,
|
private_features: PrivateFeatures,
|
||||||
|
has_labels: bool,
|
||||||
#[cfg(feature = "trace")]
|
#[cfg(feature = "trace")]
|
||||||
pub(crate) commands: Option<Vec<crate::device::trace::Command>>,
|
pub(crate) commands: Option<Vec<crate::device::trace::Command>>,
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
pub(crate) label: String,
|
pub(crate) label: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,6 +499,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
|||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
if let Some(ref label) = base.label {
|
if let Some(ref label) = base.label {
|
||||||
|
cmd_buf.has_labels = true;
|
||||||
device.raw.set_command_buffer_name(&mut raw, label);
|
device.raw.set_command_buffer_name(&mut raw, label);
|
||||||
}
|
}
|
||||||
raw.begin_primary(hal::command::CommandBufferFlags::ONE_TIME_SUBMIT);
|
raw.begin_primary(hal::command::CommandBufferFlags::ONE_TIME_SUBMIT);
|
||||||
|
Loading…
Reference in New Issue
Block a user