1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use crate::*;
/// Handle to a query set.
///
/// A `QuerySet` is an opaque, mutable storage location for the results of queries:
/// which are small pieces of information extracted from other operations such as render passes.
/// See [`QueryType`] for what types of information can be collected.
///
/// Each query writes data into one or more result slots in the `QuerySet`, which must be created
/// with a sufficient number of slots for that usage. Each result slot is a an unsigned 64-bit
/// number.
///
/// Using queries consists of the following steps:
///
/// 1. Create a `QuerySet` of the appropriate type and number of query result slots
/// using [`Device::create_query_set()`].
/// 2. Pass the `QuerySet` to the commands which will write to it.
/// See [`QueryType`] for the possible commands.
/// 3. Execute the command [`CommandEncoder::resolve_query_set()`].
/// This converts the opaque data stored in a `QuerySet` into [`u64`]s stored in a [`Buffer`].
/// 4. Make use of that buffer, such as by copying its contents to the CPU
/// or reading it from a compute shader.
///
/// Corresponds to [WebGPU `GPUQuerySet`](https://gpuweb.github.io/gpuweb/#queryset).
assert_impl_all!;
crateimpl_eq_ord_hash_proxy!;
/// Describes a [`QuerySet`].
///
/// For use with [`Device::create_query_set`].
///
/// Corresponds to [WebGPU `GPUQuerySetDescriptor`](
/// https://gpuweb.github.io/gpuweb/#dictdef-gpuquerysetdescriptor).
pub type QuerySetDescriptor<'a> = QuerySetDescriptor;
assert_impl_all!;