mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
extract insert_debug_marker
from render_pass_end_impl
This commit is contained in:
parent
10cf23b511
commit
02f91167d9
@ -1683,21 +1683,7 @@ impl Global {
|
||||
pop_debug_group(&mut state).map_pass_err(scope)?;
|
||||
}
|
||||
ArcRenderCommand::InsertDebugMarker { color: _, len } => {
|
||||
if !state
|
||||
.device
|
||||
.instance_flags
|
||||
.contains(wgt::InstanceFlags::DISCARD_HAL_LABELS)
|
||||
{
|
||||
let label = str::from_utf8(
|
||||
&base.string_data[state.string_offset..state.string_offset + len],
|
||||
)
|
||||
.unwrap();
|
||||
api_log!("RenderPass::insert_debug_marker {label:?}");
|
||||
unsafe {
|
||||
state.raw_encoder.insert_debug_marker(label);
|
||||
}
|
||||
}
|
||||
state.string_offset += len;
|
||||
insert_debug_marker(&mut state, &base.string_data, len);
|
||||
}
|
||||
ArcRenderCommand::WriteTimestamp {
|
||||
query_set,
|
||||
@ -2631,6 +2617,22 @@ fn pop_debug_group<A: HalApi>(state: &mut State<A>) -> Result<(), RenderPassErro
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn insert_debug_marker<A: HalApi>(state: &mut State<A>, string_data: &[u8], len: usize) {
|
||||
if !state
|
||||
.device
|
||||
.instance_flags
|
||||
.contains(wgt::InstanceFlags::DISCARD_HAL_LABELS)
|
||||
{
|
||||
let label =
|
||||
str::from_utf8(&string_data[state.string_offset..state.string_offset + len]).unwrap();
|
||||
api_log!("RenderPass::insert_debug_marker {label:?}");
|
||||
unsafe {
|
||||
state.raw_encoder.insert_debug_marker(label);
|
||||
}
|
||||
}
|
||||
state.string_offset += len;
|
||||
}
|
||||
|
||||
impl Global {
|
||||
pub fn render_pass_set_bind_group(
|
||||
&self,
|
||||
|
Loading…
Reference in New Issue
Block a user