Skip to content

Commit 1a37b65

Browse files
WIP: chore!: remove GPUCommandEncoder.writeTimestamp API
See [`gpuweb/gpuweb`#4370](gpuweb/gpuweb#4370).
1 parent e0ac24a commit 1a37b65

File tree

3 files changed

+0
-198
lines changed

3 files changed

+0
-198
lines changed

wgpu/src/backend/wgpu_core.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,27 +2049,6 @@ impl crate::Context for ContextWgpuCore {
20492049
}
20502050
}
20512051

2052-
fn command_encoder_write_timestamp(
2053-
&self,
2054-
encoder: &Self::CommandEncoderId,
2055-
encoder_data: &Self::CommandEncoderData,
2056-
query_set: &Self::QuerySetId,
2057-
_query_set_data: &Self::QuerySetData,
2058-
query_index: u32,
2059-
) {
2060-
if let Err(cause) = wgc::gfx_select!(encoder => self.0.command_encoder_write_timestamp(
2061-
*encoder,
2062-
*query_set,
2063-
query_index
2064-
)) {
2065-
self.handle_error_nolabel(
2066-
&encoder_data.error_sink,
2067-
cause,
2068-
"CommandEncoder::write_timestamp",
2069-
);
2070-
}
2071-
}
2072-
20732052
fn command_encoder_resolve_query_set(
20742053
&self,
20752054
encoder: &Self::CommandEncoderId,
@@ -2362,17 +2341,6 @@ impl crate::Context for ContextWgpuCore {
23622341
wgpu_compute_pass_pop_debug_group(pass_data);
23632342
}
23642343

2365-
fn compute_pass_write_timestamp(
2366-
&self,
2367-
_pass: &mut Self::ComputePassId,
2368-
pass_data: &mut Self::ComputePassData,
2369-
query_set: &Self::QuerySetId,
2370-
_query_set_data: &Self::QuerySetData,
2371-
query_index: u32,
2372-
) {
2373-
wgpu_compute_pass_write_timestamp(pass_data, *query_set, query_index)
2374-
}
2375-
23762344
fn compute_pass_begin_pipeline_statistics_query(
23772345
&self,
23782346
_pass: &mut Self::ComputePassId,
@@ -2857,17 +2825,6 @@ impl crate::Context for ContextWgpuCore {
28572825
wgpu_render_pass_pop_debug_group(pass_data);
28582826
}
28592827

2860-
fn render_pass_write_timestamp(
2861-
&self,
2862-
_pass: &mut Self::RenderPassId,
2863-
pass_data: &mut Self::RenderPassData,
2864-
query_set: &Self::QuerySetId,
2865-
_query_set_data: &Self::QuerySetData,
2866-
query_index: u32,
2867-
) {
2868-
wgpu_render_pass_write_timestamp(pass_data, *query_set, query_index)
2869-
}
2870-
28712828
fn render_pass_begin_occlusion_query(
28722829
&self,
28732830
_pass: &mut Self::RenderPassId,

wgpu/src/context.rs

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,6 @@ pub trait Context: Debug + WasmNotSendSync + Sized {
506506
encoder_data: &Self::CommandEncoderData,
507507
);
508508

509-
fn command_encoder_write_timestamp(
510-
&self,
511-
encoder: &Self::CommandEncoderId,
512-
encoder_data: &Self::CommandEncoderData,
513-
query_set: &Self::QuerySetId,
514-
query_set_data: &Self::QuerySetData,
515-
query_index: u32,
516-
);
517509
#[allow(clippy::too_many_arguments)]
518510
fn command_encoder_resolve_query_set(
519511
&self,
@@ -646,14 +638,6 @@ pub trait Context: Debug + WasmNotSendSync + Sized {
646638
pass: &mut Self::ComputePassId,
647639
pass_data: &mut Self::ComputePassData,
648640
);
649-
fn compute_pass_write_timestamp(
650-
&self,
651-
pass: &mut Self::ComputePassId,
652-
pass_data: &mut Self::ComputePassData,
653-
query_set: &Self::QuerySetId,
654-
query_set_data: &Self::QuerySetData,
655-
query_index: u32,
656-
);
657641
fn compute_pass_begin_pipeline_statistics_query(
658642
&self,
659643
pass: &mut Self::ComputePassId,
@@ -977,14 +961,6 @@ pub trait Context: Debug + WasmNotSendSync + Sized {
977961
pass: &mut Self::RenderPassId,
978962
pass_data: &mut Self::RenderPassData,
979963
);
980-
fn render_pass_write_timestamp(
981-
&self,
982-
pass: &mut Self::RenderPassId,
983-
pass_data: &mut Self::RenderPassData,
984-
query_set: &Self::QuerySetId,
985-
query_set_data: &Self::QuerySetData,
986-
query_index: u32,
987-
);
988964
fn render_pass_begin_occlusion_query(
989965
&self,
990966
pass: &mut Self::RenderPassId,
@@ -1488,14 +1464,6 @@ pub(crate) trait DynContext: Debug + WasmNotSendSync {
14881464
);
14891465
fn command_encoder_pop_debug_group(&self, encoder: &ObjectId, encoder_data: &crate::Data);
14901466

1491-
fn command_encoder_write_timestamp(
1492-
&self,
1493-
encoder: &ObjectId,
1494-
encoder_data: &crate::Data,
1495-
query_set: &ObjectId,
1496-
query_set_data: &crate::Data,
1497-
query_index: u32,
1498-
);
14991467
#[allow(clippy::too_many_arguments)]
15001468
fn command_encoder_resolve_query_set(
15011469
&self,
@@ -1620,14 +1588,6 @@ pub(crate) trait DynContext: Debug + WasmNotSendSync {
16201588
group_label: &str,
16211589
);
16221590
fn compute_pass_pop_debug_group(&self, pass: &mut ObjectId, pass_data: &mut crate::Data);
1623-
fn compute_pass_write_timestamp(
1624-
&self,
1625-
pass: &mut ObjectId,
1626-
pass_data: &mut crate::Data,
1627-
query_set: &ObjectId,
1628-
query_set_data: &crate::Data,
1629-
query_index: u32,
1630-
);
16311591
fn compute_pass_begin_pipeline_statistics_query(
16321592
&self,
16331593
pass: &mut ObjectId,
@@ -1947,14 +1907,6 @@ pub(crate) trait DynContext: Debug + WasmNotSendSync {
19471907
group_label: &str,
19481908
);
19491909
fn render_pass_pop_debug_group(&self, pass: &mut ObjectId, pass_data: &mut crate::Data);
1950-
fn render_pass_write_timestamp(
1951-
&self,
1952-
pass: &mut ObjectId,
1953-
pass_data: &mut crate::Data,
1954-
query_set: &ObjectId,
1955-
query_set_data: &crate::Data,
1956-
query_index: u32,
1957-
);
19581910
fn render_pass_begin_occlusion_query(
19591911
&self,
19601912
pass: &mut ObjectId,
@@ -2840,28 +2792,6 @@ where
28402792
Context::command_encoder_pop_debug_group(self, &encoder, encoder_data)
28412793
}
28422794

2843-
fn command_encoder_write_timestamp(
2844-
&self,
2845-
encoder: &ObjectId,
2846-
encoder_data: &crate::Data,
2847-
query_set: &ObjectId,
2848-
query_set_data: &crate::Data,
2849-
query_index: u32,
2850-
) {
2851-
let encoder = <T::CommandEncoderId>::from(*encoder);
2852-
let encoder_data = downcast_ref(encoder_data);
2853-
let query_set = <T::QuerySetId>::from(*query_set);
2854-
let query_set_data = downcast_ref(query_set_data);
2855-
Context::command_encoder_write_timestamp(
2856-
self,
2857-
&encoder,
2858-
encoder_data,
2859-
&query_set,
2860-
query_set_data,
2861-
query_index,
2862-
)
2863-
}
2864-
28652795
fn command_encoder_resolve_query_set(
28662796
&self,
28672797
encoder: &ObjectId,
@@ -3133,28 +3063,6 @@ where
31333063
Context::compute_pass_pop_debug_group(self, &mut pass, pass_data)
31343064
}
31353065

3136-
fn compute_pass_write_timestamp(
3137-
&self,
3138-
pass: &mut ObjectId,
3139-
pass_data: &mut crate::Data,
3140-
query_set: &ObjectId,
3141-
query_set_data: &crate::Data,
3142-
query_index: u32,
3143-
) {
3144-
let mut pass = <T::ComputePassId>::from(*pass);
3145-
let pass_data = downcast_mut::<T::ComputePassData>(pass_data);
3146-
let query_set = <T::QuerySetId>::from(*query_set);
3147-
let query_set_data = downcast_ref(query_set_data);
3148-
Context::compute_pass_write_timestamp(
3149-
self,
3150-
&mut pass,
3151-
pass_data,
3152-
&query_set,
3153-
query_set_data,
3154-
query_index,
3155-
)
3156-
}
3157-
31583066
fn compute_pass_begin_pipeline_statistics_query(
31593067
&self,
31603068
pass: &mut ObjectId,
@@ -3899,28 +3807,6 @@ where
38993807
Context::render_pass_pop_debug_group(self, &mut pass, pass_data)
39003808
}
39013809

3902-
fn render_pass_write_timestamp(
3903-
&self,
3904-
pass: &mut ObjectId,
3905-
pass_data: &mut crate::Data,
3906-
query_set: &ObjectId,
3907-
query_set_data: &crate::Data,
3908-
query_index: u32,
3909-
) {
3910-
let mut pass = <T::RenderPassId>::from(*pass);
3911-
let pass_data = downcast_mut::<T::RenderPassData>(pass_data);
3912-
let query_set = <T::QuerySetId>::from(*query_set);
3913-
let query_set_data = downcast_ref(query_set_data);
3914-
Context::render_pass_write_timestamp(
3915-
self,
3916-
&mut pass,
3917-
pass_data,
3918-
&query_set,
3919-
query_set_data,
3920-
query_index,
3921-
)
3922-
}
3923-
39243810
fn render_pass_begin_occlusion_query(
39253811
&self,
39263812
pass: &mut ObjectId,

wgpu/src/lib.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4317,27 +4317,6 @@ impl<'a> RenderPass<'a> {
43174317
}
43184318
}
43194319

4320-
/// [`Features::TIMESTAMP_QUERY_INSIDE_PASSES`] must be enabled on the device in order to call these functions.
4321-
impl<'a> RenderPass<'a> {
4322-
/// Issue a timestamp command at this point in the queue. The
4323-
/// timestamp will be written to the specified query set, at the specified index.
4324-
///
4325-
/// Must be multiplied by [`Queue::get_timestamp_period`] to get
4326-
/// the value in nanoseconds. Absolute values have no meaning,
4327-
/// but timestamps can be subtracted to get the time it takes
4328-
/// for a string of operations to complete.
4329-
pub fn write_timestamp(&mut self, query_set: &QuerySet, query_index: u32) {
4330-
DynContext::render_pass_write_timestamp(
4331-
&*self.parent.context,
4332-
&mut self.id,
4333-
self.data.as_mut(),
4334-
&query_set.id,
4335-
query_set.data.as_ref(),
4336-
query_index,
4337-
)
4338-
}
4339-
}
4340-
43414320
impl<'a> RenderPass<'a> {
43424321
/// Start a occlusion query on this render pass. It can be ended with
43434322
/// `end_occlusion_query`. Occlusion queries may not be nested.
@@ -4519,26 +4498,6 @@ impl<'a> ComputePass<'a> {
45194498
}
45204499
}
45214500

4522-
/// [`Features::TIMESTAMP_QUERY_INSIDE_PASSES`] must be enabled on the device in order to call these functions.
4523-
impl<'a> ComputePass<'a> {
4524-
/// Issue a timestamp command at this point in the queue. The timestamp will be written to the specified query set, at the specified index.
4525-
///
4526-
/// Must be multiplied by [`Queue::get_timestamp_period`] to get
4527-
/// the value in nanoseconds. Absolute values have no meaning,
4528-
/// but timestamps can be subtracted to get the time it takes
4529-
/// for a string of operations to complete.
4530-
pub fn write_timestamp(&mut self, query_set: &QuerySet, query_index: u32) {
4531-
DynContext::compute_pass_write_timestamp(
4532-
&*self.parent.context,
4533-
&mut self.id,
4534-
self.data.as_mut(),
4535-
&query_set.id,
4536-
query_set.data.as_ref(),
4537-
query_index,
4538-
)
4539-
}
4540-
}
4541-
45424501
/// [`Features::PIPELINE_STATISTICS_QUERY`] must be enabled on the device in order to call these functions.
45434502
impl<'a> ComputePass<'a> {
45444503
/// Start a pipeline statistics query on this compute pass. It can be ended with

0 commit comments

Comments
 (0)