mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 00:03:29 +00:00
extract write_timestamp
from compute_pass_end_impl
This commit is contained in:
parent
3ff680261d
commit
e41cfbf1c2
@ -654,18 +654,7 @@ impl Global {
|
||||
query_index,
|
||||
} => {
|
||||
let scope = PassErrorScope::WriteTimestamp;
|
||||
|
||||
query_set.same_device_as(cmd_buf).map_pass_err(scope)?;
|
||||
|
||||
state
|
||||
.device
|
||||
.require_features(wgt::Features::TIMESTAMP_QUERY_INSIDE_PASSES)
|
||||
.map_pass_err(scope)?;
|
||||
|
||||
let query_set = state.tracker.query_sets.insert_single(query_set);
|
||||
|
||||
query_set
|
||||
.validate_and_write_timestamp(raw, query_index, None)
|
||||
write_timestamp(&mut state, raw, cmd_buf, query_set, query_index)
|
||||
.map_pass_err(scope)?;
|
||||
}
|
||||
ArcComputeCommand::BeginPipelineStatisticsQuery {
|
||||
@ -1036,6 +1025,25 @@ fn insert_debug_marker<A: HalApi>(
|
||||
state.string_offset += len;
|
||||
}
|
||||
|
||||
fn write_timestamp<A: HalApi>(
|
||||
state: &mut State<A>,
|
||||
raw: &mut A::CommandEncoder,
|
||||
cmd_buf: &CommandBuffer<A>,
|
||||
query_set: Arc<resource::QuerySet<A>>,
|
||||
query_index: u32,
|
||||
) -> Result<(), ComputePassErrorInner> {
|
||||
query_set.same_device_as(cmd_buf)?;
|
||||
|
||||
state
|
||||
.device
|
||||
.require_features(wgt::Features::TIMESTAMP_QUERY_INSIDE_PASSES)?;
|
||||
|
||||
let query_set = state.tracker.query_sets.insert_single(query_set);
|
||||
|
||||
query_set.validate_and_write_timestamp(raw, query_index, None)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Recording a compute pass.
|
||||
impl Global {
|
||||
pub fn compute_pass_set_bind_group<A: HalApi>(
|
||||
|
Loading…
Reference in New Issue
Block a user