[wgpu] correct doc for resolve query set (#4849)

* Correct doc for resolve query set

* Add note about wgpu::QUERY_SIZE

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
This commit is contained in:
Valaphee The Meerkat 2023-12-09 23:56:09 +01:00 committed by GitHub
parent af701fb26d
commit 6c4128b4e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3671,6 +3671,31 @@ impl CommandEncoder {
let id = self.id.as_ref().unwrap();
DynContext::command_encoder_pop_debug_group(&*self.context, id, self.data.as_ref());
}
/// Resolves a query set, writing the results into the supplied destination buffer.
///
/// Occlusion and timestamp queries are 8 bytes each (see [`crate::QUERY_SIZE`]). For pipeline statistics queries,
/// see [`PipelineStatisticsTypes`] for more information.
pub fn resolve_query_set(
&mut self,
query_set: &QuerySet,
query_range: Range<u32>,
destination: &Buffer,
destination_offset: BufferAddress,
) {
DynContext::command_encoder_resolve_query_set(
&*self.context,
self.id.as_ref().unwrap(),
self.data.as_ref(),
&query_set.id,
query_set.data.as_ref(),
query_range.start,
query_range.end - query_range.start,
&destination.id,
destination.data.as_ref(),
destination_offset,
)
}
}
/// [`Features::TIMESTAMP_QUERY`] must be enabled on the device in order to call these functions.
@ -3694,33 +3719,6 @@ impl CommandEncoder {
}
}
/// [`Features::TIMESTAMP_QUERY`] or [`Features::PIPELINE_STATISTICS_QUERY`] must be enabled on the device in order to call these functions.
impl CommandEncoder {
/// Resolve a query set, writing the results into the supplied destination buffer.
///
/// Queries may be between 8 and 40 bytes each. See [`PipelineStatisticsTypes`] for more information.
pub fn resolve_query_set(
&mut self,
query_set: &QuerySet,
query_range: Range<u32>,
destination: &Buffer,
destination_offset: BufferAddress,
) {
DynContext::command_encoder_resolve_query_set(
&*self.context,
self.id.as_ref().unwrap(),
self.data.as_ref(),
&query_set.id,
query_set.data.as_ref(),
query_range.start,
query_range.end - query_range.start,
&destination.id,
destination.data.as_ref(),
destination_offset,
)
}
}
impl<'a> RenderPass<'a> {
/// Sets the active bind group for a given bind group index. The bind group layout
/// in the active pipeline when any `draw_*()` method is called must match the layout of