Skip to main content

Queue

Struct Queue 

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

Implementations§

Source§

impl Queue

Source

pub fn submit(&self, command_buffer: CommandBuffer) -> Result<(), Error>

Submits a CommandBuffer to the GPU queue and waits synchronously for execution to finish.

§Example
use lgpu::{CommandBuffer, Queue};

queue.submit(cmd).expect("GPU submission failed");
Source

pub fn submit_surface_work( &self, command_buffer: CommandBuffer, surface_texture: &SurfaceTexture, ) -> Result<(), Error>

Submits command buffer work targeted to a swapchain surface without presenting. The acquired surface can then be presented explicitly via SurfaceTexture::present.

Source

pub fn submit_surface( &self, command_buffer: CommandBuffer, surface_texture: SurfaceTexture, ) -> Result<(), Error>

Submits command buffer work targeted to a swapchain surface and immediately queues presentation.

Source

pub fn submit_batches( &self, command_buffers: Vec<CommandBuffer>, ) -> Result<(), Error>

Source

pub fn submit_async( &self, command_buffer: CommandBuffer, wait_semaphores: &[(&TimelineSemaphore, u64)], signal_semaphores: &[(&TimelineSemaphore, u64)], ) -> Result<(), Error>

Source

pub fn submit_batches_async( &self, command_buffers: Vec<CommandBuffer>, wait_semaphores: &[(&TimelineSemaphore, u64)], signal_semaphores: &[(&TimelineSemaphore, u64)], ) -> Result<(), Error>

Source

pub fn write_texture(&self, texture: &Texture, data: &[u8]) -> Result<(), Error>

Source

pub fn write_buffer( &self, buffer: &Buffer, offset: u64, data: &[u8], ) -> Result<(), Error>

Writes byte data into a host-mapped Buffer at the specified offset.

§Example
use lgpu::{Buffer, Queue};

queue.write_buffer(buffer, 0, &[1u8, 2, 3, 4]).expect("Failed to write buffer");

Auto Trait Implementations§

§

impl Freeze for Queue

§

impl RefUnwindSafe for Queue

§

impl Send for Queue

§

impl Sync for Queue

§

impl Unpin for Queue

§

impl UnsafeUnpin 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
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, 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.