[][src]Struct gaclen::graphics::device::Device

pub struct Device { /* fields omitted */ }

A device responsible for hardware-accelerated computations.

It is responsible for recording, submitting and synchronizing commands and data to the GPU.

Methods

impl Device[src]

pub fn new(
    context: &Context,
    window: Arc<Window>,
    present_mode: PresentMode
) -> Result<Device, DeviceCreationError>
[src]

Create a new device that targets a specific window.

pub fn resize_for_window(&mut self, window: &Window) -> Result<(), ResizeError>[src]

Update the device for the resized window.

pub fn start_frame(
    self,
    when: Option<Box<dyn GpuFuture>>,
    final_pass: &impl GraphicalPass,
    clear_value: Vec<ClearValue>
) -> Result<DrawingDevice, (Self, AcquireError)>
[src]

Start drawing the frame.

Takes ownership of the Device and converts it to a DrawingDevice. This corresponds to switching to the special 'middle of frame' state, that caches intermediate commands before submitting them to the GPU. To exit the state and get back the ownership of the Device call finish_frame method.

pub fn create_buffer<T: 'static>(
    &self,
    data_iterator: impl ExactSizeIterator<Item = T>
) -> Result<Arc<CpuAccessibleBuffer<[T]>>, DeviceMemoryAllocError>
[src]

Create a basic buffer for data for processing on the GPU.

pub fn logical_device(&self) -> Arc<LogicalDevice>[src]

Get the underlying logical device (useful for supplying to own shaders).

Trait Implementations

impl Debug for Device[src]

Auto Trait Implementations

impl Send for Device

impl Sync for Device

impl Unpin for Device

impl !UnwindSafe for Device

impl !RefUnwindSafe for Device

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Content for T[src]