pub struct CommandEncoder {
pub(crate) device: Arc<Device>,
pub(crate) label: String,
pub(crate) data: Mutex<CommandEncoderStatus>,
}Fields§
§device: Arc<Device>§label: String§data: Mutex<CommandEncoderStatus>The mutable state of this command encoder.
Implementations§
Source§impl CommandEncoder
impl CommandEncoder
Sourcepub unsafe fn as_hal_mut<A: Api, F: FnOnce(Option<&mut A::CommandEncoder>) -> R, R>(
self: &Arc<Self>,
hal_command_encoder_callback: F,
) -> R
pub unsafe fn as_hal_mut<A: Api, F: FnOnce(Option<&mut A::CommandEncoder>) -> R, R>( self: &Arc<Self>, hal_command_encoder_callback: F, ) -> R
Source§impl CommandEncoder
impl CommandEncoder
pub fn clear_buffer( self: &Arc<Self>, dst: Arc<Buffer>, offset: BufferAddress, size: Option<BufferAddress>, ) -> Result<(), EncoderStateError>
pub fn clear_texture( self: &Arc<Self>, dst: Arc<Texture>, subresource_range: &ImageSubresourceRange, ) -> Result<(), EncoderStateError>
Source§impl CommandEncoder
impl CommandEncoder
fn begin_compute_pass( self: &Arc<Self>, desc: &ComputePassDescriptor<'_, PassTimestampWrites<Arc<QuerySet>>>, ) -> (ComputePass, Option<CommandEncoderError>)
Source§impl CommandEncoder
impl CommandEncoder
pub fn write_timestamp( self: &Arc<Self>, query_set: Arc<QuerySet>, query_index: u32, ) -> Result<(), EncoderStateError>
pub fn resolve_query_set( self: &Arc<Self>, query_set: Arc<QuerySet>, start_query: u32, query_count: u32, destination: Arc<Buffer>, destination_offset: BufferAddress, ) -> Result<(), EncoderStateError>
Source§impl CommandEncoder
impl CommandEncoder
pub fn mark_acceleration_structures_built( self: &Arc<Self>, blases: &[Arc<Blas>], tlases: &[Arc<Tlas>], ) -> Result<(), EncoderStateError>
pub fn build_acceleration_structures<'a>( self: &Arc<Self>, blas_iter: impl Iterator<Item = BlasBuildEntry<'a, Arc<Blas>, Arc<Buffer>>>, tlas_iter: impl Iterator<Item = TlasPackage<'a, Arc<Tlas>, Arc<Blas>>>, ) -> Result<(), EncoderStateError>
Source§impl CommandEncoder
impl CommandEncoder
fn begin_render_pass( self: Arc<Self>, desc: ResolvedRenderPassDescriptor<'_>, ) -> (RenderPass, Option<CommandEncoderError>)
Source§impl CommandEncoder
impl CommandEncoder
pub fn copy_buffer_to_buffer( self: &Arc<Self>, source: Arc<Buffer>, source_offset: BufferAddress, destination: Arc<Buffer>, destination_offset: BufferAddress, size: Option<BufferAddress>, ) -> Result<(), EncoderStateError>
pub fn copy_buffer_to_texture( self: &Arc<Self>, source: &TexelCopyBufferInfo<Arc<Buffer>>, destination: &TexelCopyTextureInfo<Arc<Texture>>, copy_size: &Extent3d, ) -> Result<(), EncoderStateError>
pub fn copy_texture_to_buffer( self: &Arc<Self>, source: &TexelCopyTextureInfo<Arc<Texture>>, destination: &TexelCopyBufferInfo<Arc<Buffer>>, copy_size: &Extent3d, ) -> Result<(), EncoderStateError>
pub fn copy_texture_to_texture( self: &Arc<Self>, source: &TexelCopyTextureInfo<Arc<Texture>>, destination: &TexelCopyTextureInfo<Arc<Texture>>, copy_size: &Extent3d, ) -> Result<(), EncoderStateError>
Source§impl CommandEncoder
impl CommandEncoder
pub fn transition_resources( self: &Arc<Self>, buffer_transitions: impl Iterator<Item = BufferTransition<Arc<Buffer>>>, texture_transitions: impl Iterator<Item = TextureTransition<Arc<Texture>>>, ) -> Result<(), EncoderStateError>
Source§impl CommandEncoder
impl CommandEncoder
pub(crate) fn new( encoder: Box<dyn DynCommandEncoder>, device: &Arc<Device>, label: &Label<'_>, ) -> Self
pub(crate) fn new_invalid( device: &Arc<Device>, label: &Label<'_>, err: CommandEncoderError, ) -> Arc<Self>
pub(crate) fn validate_pass_timestamp_writes<E>(
device: &Device,
timestamp_writes: &PassTimestampWrites<Arc<QuerySet>>,
) -> Result<PassTimestampWrites<Arc<QuerySet>>, E>where
E: From<TimestampWritesError> + From<QueryUseError> + From<DeviceError> + From<MissingFeatures> + From<InvalidResourceError>,
pub(crate) fn insert_barriers_from_tracker( raw: &mut dyn DynCommandEncoder, base: &mut Tracker, head: &Tracker, snatch_guard: &SnatchGuard<'_>, )
pub(crate) fn insert_barriers_from_scope( raw: &mut dyn DynCommandEncoder, base: &mut Tracker, head: &UsageScope<'_>, snatch_guard: &SnatchGuard<'_>, )
pub(crate) fn drain_barriers( raw: &mut dyn DynCommandEncoder, base: &mut Tracker, snatch_guard: &SnatchGuard<'_>, )
pub(crate) fn insert_barriers_from_device_tracker( raw: &mut dyn DynCommandEncoder, base: &mut DeviceTracker, head: &Tracker, snatch_guard: &SnatchGuard<'_>, )
fn encode_commands( device: &Arc<Device>, cmd_buf_data: &mut CommandBufferMutable, ) -> Result<(), CommandEncoderError>
Sourcepub fn finish(
self: &Arc<Self>,
desc: &CommandBufferDescriptor<Label<'_>>,
) -> (Arc<CommandBuffer>, Option<(String, CommandEncoderError)>)
pub fn finish( self: &Arc<Self>, desc: &CommandBufferDescriptor<Label<'_>>, ) -> (Arc<CommandBuffer>, Option<(String, CommandEncoderError)>)
Finishes a command encoder, creating a command buffer and returning errors that were deferred until now.
The returned String is the label of the command encoder, supplied so that wgpu can
include the label when printing deferred errors without having its own copy of the label.
This is a kludge and should be replaced if we think of a better solution to propagating
labels.
Source§impl CommandEncoder
impl CommandEncoder
pub fn push_debug_group( self: &Arc<Self>, label: &str, ) -> Result<(), EncoderStateError>
pub fn insert_debug_marker( self: &Arc<Self>, label: &str, ) -> Result<(), EncoderStateError>
pub fn pop_debug_group(self: &Arc<Self>) -> Result<(), EncoderStateError>
Trait Implementations§
Source§impl Drop for CommandEncoder
impl Drop for CommandEncoder
Source§impl Labeled for CommandEncoder
impl Labeled for CommandEncoder
Source§fn label(&self) -> &str
fn label(&self) -> &str
Returns a string identifying this resource for logging and errors. Read more
fn error_ident(&self) -> ResourceErrorIdent
Source§impl ParentDevice for CommandEncoder
impl ParentDevice for CommandEncoder
Source§impl ResourceType for CommandEncoder
impl ResourceType for CommandEncoder
Auto Trait Implementations§
impl !Freeze for CommandEncoder
impl !RefUnwindSafe for CommandEncoder
impl Send for CommandEncoder
impl Sync for CommandEncoder
impl Unpin for CommandEncoder
impl !UnwindSafe for CommandEncoder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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