CommandEncoder

Struct CommandEncoder 

Source
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

Source

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

Encode commands using the raw HAL command encoder.

§Panics

If the command encoder has already been used with the wgpu encoding API.

§Safety
  • The raw command encoder handle must not be manually destroyed
Source§

impl CommandEncoder

Source

fn clear_buffer_inner( self: &Arc<Self>, dst: Arc<Buffer>, offset: BufferAddress, size: Option<BufferAddress>, ) -> Result<(), EncoderStateError>

Source

pub fn clear_buffer( self: &Arc<Self>, dst: Arc<Buffer>, offset: BufferAddress, size: Option<BufferAddress>, )

Source

fn clear_texture_inner( self: &Arc<Self>, dst: Arc<Texture>, subresource_range: &ImageSubresourceRange, ) -> Result<(), EncoderStateError>

Source

pub fn clear_texture( self: &Arc<Self>, dst: Arc<Texture>, subresource_range: &ImageSubresourceRange, )

Source§

impl CommandEncoder

Source§

impl CommandEncoder

Source

fn write_timestamp_inner( self: &Arc<Self>, query_set: Arc<QuerySet>, query_index: u32, ) -> Result<(), EncoderStateError>

Source

pub fn write_timestamp( self: &Arc<Self>, query_set: Arc<QuerySet>, query_index: u32, )

Source

fn resolve_query_set_inner( self: &Arc<Self>, query_set: Arc<QuerySet>, start_query: u32, query_count: u32, destination: Arc<Buffer>, destination_offset: BufferAddress, ) -> Result<(), EncoderStateError>

Source

pub fn resolve_query_set( self: &Arc<Self>, query_set: Arc<QuerySet>, start_query: u32, query_count: u32, destination: Arc<Buffer>, destination_offset: BufferAddress, )

Source§

impl CommandEncoder

Source

fn mark_acceleration_structures_built_inner( self: &Arc<Self>, blases: &[Arc<Blas>], tlases: &[Arc<Tlas>], ) -> Result<(), EncoderStateError>

Source

pub fn mark_acceleration_structures_built( self: &Arc<Self>, blases: &[Arc<Blas>], tlases: &[Arc<Tlas>], )

Source

fn build_acceleration_structures_inner<'a>( self: &Arc<Self>, blas_iter: impl Iterator<Item = BlasBuildEntry<'a, Arc<Blas>, Arc<Buffer>>>, tlases: Vec<ArcTlasPackage>, ) -> Result<(), EncoderStateError>

Source

pub fn build_acceleration_structures<'a>( self: &Arc<Self>, blas_iter: impl Iterator<Item = BlasBuildEntry<'a, Arc<Blas>, Arc<Buffer>>>, tlases: Vec<ArcTlasPackage>, )

Source§

impl CommandEncoder

Source§

impl CommandEncoder

Source

fn copy_buffer_to_buffer_inner( self: &Arc<Self>, source: Arc<Buffer>, source_offset: BufferAddress, destination: Arc<Buffer>, destination_offset: BufferAddress, size: Option<BufferAddress>, ) -> Result<(), EncoderStateError>

Source

pub fn copy_buffer_to_buffer( self: &Arc<Self>, source: Arc<Buffer>, source_offset: BufferAddress, destination: Arc<Buffer>, destination_offset: BufferAddress, size: Option<BufferAddress>, )

Source

fn copy_buffer_to_texture_inner( self: &Arc<Self>, source: &TexelCopyBufferInfo<Arc<Buffer>>, destination: &TexelCopyTextureInfo<Arc<Texture>>, copy_size: &Extent3d, ) -> Result<(), EncoderStateError>

Source

pub fn copy_buffer_to_texture( self: &Arc<Self>, source: &TexelCopyBufferInfo<Arc<Buffer>>, destination: &TexelCopyTextureInfo<Arc<Texture>>, copy_size: &Extent3d, )

Source

fn copy_texture_to_buffer_inner( self: &Arc<Self>, source: &TexelCopyTextureInfo<Arc<Texture>>, destination: &TexelCopyBufferInfo<Arc<Buffer>>, copy_size: &Extent3d, ) -> Result<(), EncoderStateError>

Source

pub fn copy_texture_to_buffer( self: &Arc<Self>, source: &TexelCopyTextureInfo<Arc<Texture>>, destination: &TexelCopyBufferInfo<Arc<Buffer>>, copy_size: &Extent3d, )

Source

fn copy_texture_to_texture_inner( self: &Arc<Self>, source: &TexelCopyTextureInfo<Arc<Texture>>, destination: &TexelCopyTextureInfo<Arc<Texture>>, copy_size: &Extent3d, ) -> Result<(), EncoderStateError>

Source

pub fn copy_texture_to_texture( self: &Arc<Self>, source: &TexelCopyTextureInfo<Arc<Texture>>, destination: &TexelCopyTextureInfo<Arc<Texture>>, copy_size: &Extent3d, )

Source§

impl CommandEncoder

Source

fn transition_resources_inner( self: &Arc<Self>, buffer_transitions: impl Iterator<Item = BufferTransition<Arc<Buffer>>>, texture_transitions: impl Iterator<Item = TextureTransition<Arc<Texture>>>, ) -> Result<(), EncoderStateError>

Source

pub fn transition_resources( self: &Arc<Self>, buffer_transitions: impl Iterator<Item = BufferTransition<Arc<Buffer>>>, texture_transitions: impl Iterator<Item = TextureTransition<Arc<Texture>>>, )

Source§

impl CommandEncoder

Source

pub(crate) fn new( encoder: Box<dyn DynCommandEncoder>, device: &Arc<Device>, label: &Label<'_>, ) -> Self

Source

pub(crate) fn new_invalid( device: &Arc<Device>, label: &Label<'_>, err: CommandEncoderError, ) -> Arc<Self>

Source

pub(crate) fn validate_pass_timestamp_writes<E>( device: &Device, timestamp_writes: &PassTimestampWrites<Arc<QuerySet>>, ) -> Result<PassTimestampWrites, E>

Source

pub(crate) fn insert_barriers_from_tracker( raw: &mut dyn DynCommandEncoder, base: &mut Tracker, head: &Tracker, snatch_guard: &SnatchGuard<'_>, )

Source

pub(crate) fn insert_barriers_from_scope( raw: &mut dyn DynCommandEncoder, base: &mut Tracker, head: &UsageScope<'_>, snatch_guard: &SnatchGuard<'_>, )

Source

pub(crate) fn drain_barriers( raw: &mut dyn DynCommandEncoder, base: &mut Tracker, snatch_guard: &SnatchGuard<'_>, )

Source

pub(crate) fn insert_barriers_from_device_tracker( raw: &mut dyn DynCommandEncoder, base: &mut DeviceTracker, head: &Tracker, snatch_guard: &SnatchGuard<'_>, )

Source

fn encode_commands( device: &Arc<Device>, cmd_buf_data: &mut CommandBufferMutable, ) -> Result<(), CommandEncoderError>

Source

fn finish_inner( self: &Arc<Self>, desc: &CommandBufferDescriptor<Label<'_>>, ) -> (Arc<CommandBuffer>, Option<CommandEncoderError>)

Finishes a command encoder, creating a command buffer and returning errors that were deferred until now.

Source

pub fn finish( self: &Arc<Self>, desc: &CommandBufferDescriptor<Label<'_>>, ) -> Arc<CommandBuffer>

Source§

impl CommandEncoder

Source

fn push_debug_group_inner( self: &Arc<Self>, label: &str, ) -> Result<(), EncoderStateError>

Source

pub fn push_debug_group(self: &Arc<Self>, label: &str)

Source

fn insert_debug_marker_inner( self: &Arc<Self>, label: &str, ) -> Result<(), EncoderStateError>

Source

pub fn insert_debug_marker(self: &Arc<Self>, label: &str)

Source

fn pop_debug_group_inner(self: &Arc<Self>) -> Result<(), EncoderStateError>

Source

pub fn pop_debug_group(self: &Arc<Self>)

Trait Implementations§

Source§

impl Drop for CommandEncoder

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Labeled for CommandEncoder

Source§

fn label(&self) -> &str

Returns a string identifying this resource for logging and errors. Read more
Source§

fn error_ident(&self) -> ResourceErrorIdent

Source§

impl ParentDevice for CommandEncoder

Source§

fn device(&self) -> &Arc<Device>

Source§

fn is_equal(self: &Arc<Self>, other: &Arc<Self>) -> bool

Source§

fn same_device_as<O: ParentDevice>(&self, other: &O) -> Result<(), DeviceError>

Source§

fn same_device(&self, device: &Device) -> Result<(), DeviceError>

Source§

impl ResourceType for CommandEncoder

Source§

const TYPE: &'static str = "CommandEncoder"

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,