pub struct RenderBundleEncoder {
base: BasePass<RenderCommand<IdReferences>, Infallible>,
parent_id: DeviceId,
parent: Option<()>,
pub(crate) context: RenderPassContext,
pub(crate) is_depth_read_only: bool,
pub(crate) is_stencil_read_only: bool,
current_bind_groups: BindGroupStateChange,
current_pipeline: StateChange<RenderPipelineId>,
}Fields§
§base: BasePass<RenderCommand<IdReferences>, Infallible>§parent_id: DeviceId§parent: Option<()>State of the render bundle encoder. Encoded to be compatible with pass macros.
If this is Some, then the pass is in WebGPU’s “open” state. If it is
None, then the pass is in the “ended” state.
See https://www.w3.org/TR/webgpu/#encoder-state
context: RenderPassContext§is_depth_read_only: bool§is_stencil_read_only: bool§current_bind_groups: BindGroupStateChange§current_pipeline: StateChange<RenderPipelineId>Implementations§
Source§impl RenderBundleEncoder
impl RenderBundleEncoder
Sourcepub fn new(
desc: &RenderBundleEncoderDescriptor<'_>,
device: Option<&Arc<Device>>,
parent_id: DeviceId,
) -> Result<Self, CreateRenderBundleError>
pub fn new( desc: &RenderBundleEncoderDescriptor<'_>, device: Option<&Arc<Device>>, parent_id: DeviceId, ) -> Result<Self, CreateRenderBundleError>
Create a new RenderBundleEncoder.
The underlying device is required to fully validate the descriptor.
If the device is not available, some validation will be deferred
until finish().
pub fn dummy(parent_id: DeviceId) -> Self
pub fn parent(&self) -> DeviceId
Sourcepub(crate) fn finish(
&mut self,
desc: &RenderBundleDescriptor<'_>,
device: &Arc<Device>,
hub: &Hub,
) -> Result<Arc<RenderBundle>, RenderBundleError>
pub(crate) fn finish( &mut self, desc: &RenderBundleDescriptor<'_>, device: &Arc<Device>, hub: &Hub, ) -> Result<Arc<RenderBundle>, RenderBundleError>
Convert this encoder’s commands into a RenderBundle.
We want executing a RenderBundle to be quick, so we take
this opportunity to clean up the RenderBundleEncoder’s
command stream and gather metadata about it that will help
keep ExecuteBundle simple and fast. We remove redundant
commands (along with their side data), note resource usage,
and accumulate buffer and texture initialization actions.