Queue

Struct Queue 

Source
pub struct Queue {
    raw: Box<dyn DynQueue>,
    pub(crate) pending_writes: Mutex<PendingWrites>,
    life_tracker: Mutex<LifetimeTracker>,
    pub(crate) device: Arc<Device>,
}

Fields§

§raw: Box<dyn DynQueue>§pending_writes: Mutex<PendingWrites>§life_tracker: Mutex<LifetimeTracker>§device: Arc<Device>

Implementations§

Source§

impl Queue

Source

pub(crate) fn new( device: Arc<Device>, raw: Box<dyn DynQueue>, instance_flags: InstanceFlags, ) -> Result<Self, DeviceError>

Source

pub(crate) fn raw(&self) -> &dyn DynQueue

Source

pub(crate) fn lock_life<'a>(&'a self) -> MutexGuard<'a, LifetimeTracker>

Source

pub(crate) fn prepare_surface_texture_for_present( &self, texture: &Arc<Texture>, ) -> Result<(), DeviceError>

Ensure the surface texture is in the PRESENT state, clearing it if it was never rendered to. Submits any necessary work to the GPU before the HAL present call.

See https://github.com/gfx-rs/wgpu/issues/6748

Source

pub(crate) fn maintain( &self, submission_index: u64, snatch_guard: &SnatchGuard<'_>, ) -> (SmallVec<[SubmittedWorkDoneClosure; 1]>, Vec<BufferMapPendingClosure>, Vec<BlasCompactReadyPendingClosure>, bool)

Source§

impl Queue

Source

pub fn write_buffer( &self, buffer: Arc<Buffer>, buffer_offset: BufferAddress, data: &[u8], ) -> Result<(), QueueWriteError>

Source

pub fn create_staging_buffer( &self, buffer_size: BufferSize, ) -> Result<(StagingBuffer, NonNull<u8>), QueueWriteError>

Source

pub fn write_staging_buffer( &self, buffer: Fallible<Buffer>, buffer_offset: BufferAddress, staging_buffer: StagingBuffer, ) -> Result<(), QueueWriteError>

Source

pub fn validate_write_buffer( &self, buffer: Fallible<Buffer>, buffer_offset: u64, buffer_size: BufferSize, ) -> Result<(), QueueWriteError>

Source

fn validate_write_buffer_impl( &self, buffer: &Buffer, buffer_offset: u64, buffer_size: u64, ) -> Result<(), TransferError>

Source

fn write_staging_buffer_impl( &self, snatch_guard: &SnatchGuard<'_>, pending_writes: &mut PendingWrites, staging_buffer: &FlushedStagingBuffer, buffer: Arc<Buffer>, buffer_offset: u64, ) -> Result<(), QueueWriteError>

Source

pub fn write_texture( &self, destination: TexelCopyTextureInfo<Arc<Texture>>, data: &[u8], data_layout: &TexelCopyBufferLayout, size: &Extent3d, ) -> Result<(), QueueWriteError>

Source

fn trace_submission( &self, submit_index: SubmissionIndex, commands: Vec<Command<PointerReferences>>, )

Available on crate feature trace only.
Source

fn trace_failed_submission( &self, submit_index: SubmissionIndex, commands: Option<Vec<Command<PointerReferences>>>, error: String, )

Available on crate feature trace only.
Source

pub fn submit( &self, command_buffers: &[Arc<CommandBuffer>], ) -> Result<SubmissionIndex, (SubmissionIndex, QueueSubmitError)>

Source

fn submit_with_pending_writes( &self, pending_writes: &mut PendingWrites, active_executions: Vec<EncoderInFlight>, surface_textures: HashMap<*const Texture, Arc<Texture>, BuildHasherDefault<FxHasher>>, fence: &mut dyn DynFence, submit_index: SubmissionIndex, snatch_guard: &SnatchGuard<'_>, ) -> Result<(), DeviceError>

Flush pending writes and any additional command encoders as a HAL submission.

Advances last_successful_submission_index and registers the submission with the lifetime tracker.

Source

pub fn get_timestamp_period(&self) -> f32

Source

pub fn on_submitted_work_done( &self, closure: SubmittedWorkDoneClosure, ) -> Option<SubmissionIndex>

closure is guaranteed to be called.

Source

pub fn compact_blas( &self, blas: &Arc<Blas>, ) -> Result<Arc<Blas>, CompactBlasError>

Source§

impl Queue

Source

pub fn present(&self, surface: &Surface) -> Result<Status, SurfaceError>

Trait Implementations§

Source§

impl Drop for Queue

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Labeled for Queue

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 Queue

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 Queue

Source§

const TYPE: &'static str = "Queue"

Auto Trait Implementations§

§

impl !Freeze for Queue

§

impl !RefUnwindSafe for Queue

§

impl Send for Queue

§

impl Sync for Queue

§

impl Unpin for Queue

§

impl !UnwindSafe for Queue

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<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

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