wgpu/api/
render_bundle.rs

1use crate::*;
2
3/// Pre-prepared reusable bundle of GPU operations.
4///
5/// It only supports a handful of render commands, but it makes them reusable. Executing a
6/// [`RenderBundle`] is often more efficient than issuing the underlying commands manually.
7///
8/// It can be created by use of a [`RenderBundleEncoder`], and executed onto a [`CommandEncoder`]
9/// using [`RenderPass::execute_bundles`].
10///
11/// Corresponds to [WebGPU `GPURenderBundle`](https://gpuweb.github.io/gpuweb/#render-bundle).
12#[derive(Debug, Clone)]
13pub struct RenderBundle {
14    pub(crate) inner: dispatch::DispatchRenderBundle,
15}
16#[cfg(send_sync)]
17static_assertions::assert_impl_all!(RenderBundle: Send, Sync);
18
19crate::cmp::impl_eq_ord_hash_proxy!(RenderBundle => .inner);
20
21/// Describes a [`RenderBundle`].
22///
23/// For use with [`RenderBundleEncoder::finish`].
24///
25/// Corresponds to [WebGPU `GPURenderBundleDescriptor`](
26/// https://gpuweb.github.io/gpuweb/#dictdef-gpurenderbundledescriptor).
27pub type RenderBundleDescriptor<'a> = wgt::RenderBundleDescriptor<Label<'a>>;
28static_assertions::assert_impl_all!(RenderBundleDescriptor<'_>: Send, Sync);