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 fn finish(
&mut self,
desc: &RenderBundleDescriptor<'_>,
device: &Arc<Device>,
hub: &Hub,
) -> (Arc<RenderBundle>, Option<RenderBundleError>)
pub fn finish( &mut self, desc: &RenderBundleDescriptor<'_>, device: &Arc<Device>, hub: &Hub, ) -> (Arc<RenderBundle>, Option<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.
Sourcepub(crate) fn finish_inner(
&mut self,
desc: &RenderBundleDescriptor<'_>,
device: &Arc<Device>,
hub: &Hub,
) -> Result<Arc<RenderBundle>, RenderBundleError>
pub(crate) fn finish_inner( &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.
pub fn set_index_buffer( &mut self, buffer: BufferId, index_format: IndexFormat, offset: BufferAddress, size: Option<BufferSize>, ) -> Result<(), PassStateError>
pub fn set_bind_group( &mut self, index: u32, bind_group_id: Option<BindGroupId>, offsets: &[DynamicOffset], ) -> Result<(), PassStateError>
pub fn set_pipeline( &mut self, pipeline_id: RenderPipelineId, ) -> Result<(), PassStateError>
pub fn set_vertex_buffer( &mut self, slot: u32, buffer_id: Option<BufferId>, offset: BufferAddress, size: Option<BufferSize>, ) -> Result<(), PassStateError>
pub fn set_immediates( &mut self, offset: u32, data: &[u8], ) -> Result<(), PassStateError>
pub fn draw( &mut self, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32, ) -> Result<(), PassStateError>
pub fn draw_indexed( &mut self, index_count: u32, instance_count: u32, first_index: u32, base_vertex: i32, first_instance: u32, ) -> Result<(), PassStateError>
pub fn draw_indirect( &mut self, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn draw_indexed_indirect( &mut self, buffer_id: BufferId, offset: BufferAddress, ) -> Result<(), PassStateError>
pub fn push_debug_group(&mut self, _label: &str) -> Result<(), PassStateError>
pub fn pop_debug_group(&mut self) -> Result<(), PassStateError>
pub fn insert_debug_marker( &mut self, _label: &str, ) -> Result<(), PassStateError>
Trait Implementations§
Source§impl Debug for RenderBundleEncoder
impl Debug for RenderBundleEncoder
Source§impl<'de> Deserialize<'de> for RenderBundleEncoder
impl<'de> Deserialize<'de> for RenderBundleEncoder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl ResourceType for RenderBundleEncoder
impl ResourceType for RenderBundleEncoder
Auto Trait Implementations§
impl Freeze for RenderBundleEncoder
impl RefUnwindSafe for RenderBundleEncoder
impl Send for RenderBundleEncoder
impl Sync for RenderBundleEncoder
impl Unpin for RenderBundleEncoder
impl UnwindSafe for RenderBundleEncoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more