[][src]Trait web_glitz::buffer::IntoBuffer

pub trait IntoBuffer<T> where
    T: ?Sized
{ fn into_buffer<Rc>(
        self,
        context: &Rc,
        buffer_id: BufferId,
        usage_hint: UsageHint
    ) -> Buffer<T>
    where
        Rc: RenderingContext + Clone + 'static
; }

Trait implemented for types that represent or contain data that may be stored in a Buffer.

Uploading data to a buffer involves doing a bitwise copy, as does downloading data from a buffer. WebGlitz relies on the semantics associated with the Copy trait to ensure that this is safe and does not result in memory leaks.

Required methods

fn into_buffer<Rc>(
    self,
    context: &Rc,
    buffer_id: BufferId,
    usage_hint: UsageHint
) -> Buffer<T> where
    Rc: RenderingContext + Clone + 'static, 

Stores the data in a buffer belonging to the given context, using the given usage_hint.

This consumes the Rust value and produces a GPU-accessible Buffer containing a bitwise copy of data.

The usage hint may be used by the GPU driver for performance optimizations, see UsageHint for details.

Loading content...

Implementors

impl<D, T> IntoBuffer<[T]> for D where
    D: Borrow<[T]> + 'static,
    T: Copy + 'static, 
[src]

impl<D, T> IntoBuffer<T> for D where
    D: Borrow<T> + 'static,
    T: Copy + 'static, 
[src]

Loading content...