Skip to main content

InstanceUpload

Struct InstanceUpload 

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

Checked immutable device payload without graphics API handles.

Implementations§

Source§

impl InstanceUpload

Source

pub fn new( records: impl ExactSizeIterator<Item = InstanceRecord>, sprite_size: [u32; 2], texels: impl IntoIterator<Item = [f32; 4]>, ) -> Result<Self, ValidationError>

Encodes checked twelve-word source-over primitives followed by a shared row-major linear RGBA image. A zero image size requires no texels; sprite records require a nonempty image.

Source

pub fn new_blended( records: impl ExactSizeIterator<Item = InstanceRecord>, sprite_size: [u32; 2], texels: impl IntoIterator<Item = [f32; 4]>, blend: InstanceBlend, ) -> Result<Self, ValidationError>

Like Self::new, with an explicit batch compositing rule.

Source

pub fn new_extended( records: impl ExactSizeIterator<Item = ExtendedInstanceRecord>, sprite_size: [u32; 2], texels: impl IntoIterator<Item = [f32; 4]>, blend: InstanceBlend, ) -> Result<Self, ValidationError>

Encodes versioned sixteen-word primitives and a batch compositing rule.

Source

pub fn len(&self) -> usize

Number of encoded primitives.

Source

pub fn is_empty(&self) -> bool

Whether no primitives are encoded.

Source

pub fn bytes(&self) -> u64

Exact logical byte charge, including the header and shared image.

Source

pub fn into_words(self) -> Vec<f32>

Transfers the validated words to the device planner without another allocation.

Trait Implementations§

Source§

impl Debug for InstanceUpload

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.