Struct GpuInstanceRecord
#[repr(C)]pub struct GpuInstanceRecord {
pub world_from_local: [[f32; 4]; 4],
pub normal_from_local: [[f32; 4]; 3],
pub semantic_id_words: [u32; 2],
pub orientation_sign: f32,
pub _padding: u32,
}Expand description
Stable upload record for mesh instances shared by native and WASM WebGPU paths.
The normal matrix is precomputed during cold scene construction/update, avoiding an inverse in
the vertex shader. The two identity words encode the low then high halves of a u64, avoiding
a shader-side u64 feature requirement. The 128-byte record keeps each matrix on a 16-byte
boundary in the WGSL storage-buffer array.
Fields§
§world_from_local: [[f32; 4]; 4]§normal_from_local: [[f32; 4]; 3]Column-major inverse-transpose of the instance transform’s upper-left 3x3.
semantic_id_words: [u32; 2]§orientation_sign: f32Sign of the transform determinant; flips tangent-frame handedness under reflection.
_padding: u32Implementations§
§impl GpuInstanceRecord
impl GpuInstanceRecord
pub fn new(
world_from_local: [[f32; 4]; 4],
semantic_id: u64,
) -> GpuInstanceRecord
pub fn new( world_from_local: [[f32; 4]; 4], semantic_id: u64, ) -> GpuInstanceRecord
Creates a default GpuInstanceRecord.
pub const fn semantic_id(self) -> u64
pub const fn semantic_id(self) -> u64
GpuInstanceRecord::semantic_id.
Trait Implementations§
§impl Clone for GpuInstanceRecord
impl Clone for GpuInstanceRecord
§fn clone(&self) -> GpuInstanceRecord
fn clone(&self) -> GpuInstanceRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GpuInstanceRecord
§impl Debug for GpuInstanceRecord
impl Debug for GpuInstanceRecord
§impl PartialEq for GpuInstanceRecord
impl PartialEq for GpuInstanceRecord
impl Pod for GpuInstanceRecord
impl StructuralPartialEq for GpuInstanceRecord
Auto Trait Implementations§
impl Freeze for GpuInstanceRecord
impl RefUnwindSafe for GpuInstanceRecord
impl Send for GpuInstanceRecord
impl Sync for GpuInstanceRecord
impl Unpin for GpuInstanceRecord
impl UnsafeUnpin for GpuInstanceRecord
impl UnwindSafe for GpuInstanceRecord
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
impl<T> AnyBitPattern for Twhere
T: Pod,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Interleave for Twhere
T: Pod,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more