Skip to main content

Queue

Struct Queue 

Source
pub struct Queue { /* private fields */ }
Expand description

the device’s queue (graphics, compute, copies, presentation)

Implementations§

Source§

impl Queue

Source

pub fn submit<'a, I: IntoIterator<Item = CommandBuffer<'a>>>( &self, cmds: I, ) -> Result<SubmitId>

run command buffers in order (after the pending uploads) -> their timeline value

Source

pub fn flush(&self) -> Result<SubmitId>

submit the pending uploads now

Source

pub fn write_buffer<T: Pod>( &self, buf: &Buffer, offset: u64, data: &[T], ) -> Result<()>

write data into a buffer at offset before the next submission (staged)

Source

pub fn write_texture( &self, dst: &TextureRegion<'_>, data: &[u8], layout: DataLayout, before: Layout, after: Layout, ) -> Result<()>

write texels into a texture region before the next submission (staged): the region goes from before to CopyDst, gets the data, then goes to after

Source

pub fn write_texture_rects( &self, t: &Texture, rects: &[[i32; 4]], data: &[u8], stride: u32, before: Layout, after: Layout, ) -> Result<()>

write rectangles (x, y, w, h; clipped to the texture, empty ones skipped) of mip 0, layer 0 of a 2D texture from data, an image of the texture’s size in rows of stride bytes (a framebuffer), before the next submission; the staged bytes are those of the rectangles. The whole level goes from before to CopyDst and then to after, once for all of them

Source

pub fn write_texture_rects_at( &self, t: &Texture, rects: &[[i32; 4]], origin: (i32, i32), data: &[u8], stride: u32, before: Layout, after: Layout, ) -> Result<()>

write_texture_rects from an image of another size: rectangles (x, y, w, h) of data, an image in rows of stride bytes, go to (x - origin.0, y - origin.1) of the texture; what lies outside the image or the texture is skipped

Source

pub fn read_buffer<T: Pod>( &self, buf: &Buffer, offset: u64, out: &mut [T], ) -> Result<()>

read a buffer’s contents at offset (copies through a readback buffer when needed, submits and waits for the GPU: the slow path, for tools and tests)

Trait Implementations§

Source§

impl Clone for Queue

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Queue

§

impl !UnwindSafe for Queue

§

impl Forget for Queue

§

impl Freeze for Queue

§

impl Send for Queue

§

impl Sync for Queue

§

impl Unpin for Queue

§

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.