Skip to main content

MeshUpload

Struct MeshUpload 

Source
pub struct MeshUpload<'a> {
    pub label: &'a str,
    pub vertices: &'a [u8],
    pub indices: &'a [u32],
    pub uv_range: UvRange,
    pub flags: u32,
}
Expand description

One mesh as a caller hands it to MeshPool::upload.

A description rather than six positional arguments, on MeshPoolDesc’s terms: three of the five are slices whose order a caller has no way to check at the call site, and vertices and indices swapped is a mesh that uploads and draws nothing.

Fields§

§label: &'a str

Debug name for the staging buffer and the command buffer this upload records into, so a capture says which mesh a copy belongs to.

§vertices: &'a [u8]

VERTEX_STRIDE-strided vertex data — one MeshVertex::to_bytes record each, interleaved, which is not how the pool stores them: MeshPool::upload is where the two streams are separated, so a caller describes geometry once and the position region stays contiguous for the passes that read nothing else.

§indices: &'a [u32]

Triangle indices, mesh-relative: the base vertex reaches the GPU beside them rather than inside them, so a mesh’s bytes never depend on where in the pool it landed. The module docs say by which route.

§uv_range: UvRange

The pair every UV lane in vertices was quantised against, on its way to MeshRange::uv_range and the mesh table.

§flags: u32

The mesh’s own bits, on their way to MeshRange::flags — today only GpuMesh::MESH_AUTHORED_TANGENTS.

Trait Implementations§

Source§

impl<'a> Clone for MeshUpload<'a>

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

impl<'a> Copy for MeshUpload<'a>

Source§

impl<'a> Debug for MeshUpload<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Forget for MeshUpload<'a>

§

impl<'a> Freeze for MeshUpload<'a>

§

impl<'a> Move for MeshUpload<'a>

§

impl<'a> RefUnwindSafe for MeshUpload<'a>

§

impl<'a> Send for MeshUpload<'a>

§

impl<'a> Sync for MeshUpload<'a>

§

impl<'a> Unpin for MeshUpload<'a>

§

impl<'a> UnsafeUnpin for MeshUpload<'a>

§

impl<'a> UnwindSafe for MeshUpload<'a>

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> HalThreadSafe for T
where T: Send + Sync,

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.