mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
extract push_debug_group
from render_pass_end_impl
This commit is contained in:
parent
c42c02e801
commit
4edebc6444
@ -1676,23 +1676,7 @@ impl Global {
|
||||
.map_pass_err(scope)?;
|
||||
}
|
||||
ArcRenderCommand::PushDebugGroup { color: _, len } => {
|
||||
state.debug_scope_depth += 1;
|
||||
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::push_debug_group {label:?}");
|
||||
unsafe {
|
||||
state.raw_encoder.begin_debug_marker(label);
|
||||
}
|
||||
}
|
||||
state.string_offset += len;
|
||||
push_debug_group(&mut state, &base.string_data, len);
|
||||
}
|
||||
ArcRenderCommand::PopDebugGroup => {
|
||||
api_log!("RenderPass::pop_debug_group");
|
||||
@ -2625,6 +2609,24 @@ fn multi_draw_indirect_count<A: HalApi>(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn push_debug_group<A: HalApi>(state: &mut State<A>, string_data: &[u8], len: usize) {
|
||||
state.debug_scope_depth += 1;
|
||||
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::push_debug_group {label:?}");
|
||||
unsafe {
|
||||
state.raw_encoder.begin_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