#[repr(C, align(16))]pub struct CameraUniformData {
pub view_projection: Mat4,
pub camera_position: [f32; 4],
}Expand description
The GPU-side representation of camera uniform data.
This structure is designed to be directly uploaded to a uniform buffer. The layout must match the uniform block declaration in the shader.
Important: WGSL has specific alignment requirements. Mat4 is aligned to 16 bytes, and Vec3 needs padding to be treated as Vec4 in uniform buffers.
Fields§
§view_projection: Mat4The combined view-projection matrix (projection * view).
camera_position: [f32; 4]The camera’s position in world space. Note: The fourth component is padding for alignment.
Implementations§
Trait Implementations§
Source§impl Clone for CameraUniformData
impl Clone for CameraUniformData
Source§fn clone(&self) -> CameraUniformData
fn clone(&self) -> CameraUniformData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CameraUniformData
impl Debug for CameraUniformData
impl Copy for CameraUniformData
impl Pod for CameraUniformData
Auto Trait Implementations§
impl Freeze for CameraUniformData
impl RefUnwindSafe for CameraUniformData
impl Send for CameraUniformData
impl Sync for CameraUniformData
impl Unpin for CameraUniformData
impl UnwindSafe for CameraUniformData
Blanket Implementations§
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<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.