#[repr(C)]pub struct DefaultConstantUniforms {
pub screen_to_clip_scale: [f32; 2],
pub scale_factor: f32,
pub _padding: f32,
}
Expand description
A default shader uniform struct containing the scale factor and a scaling vector used to convert from screen space to clip space.
Fields§
§screen_to_clip_scale: [f32; 2]
§scale_factor: f32
§_padding: f32
Implementations§
Source§impl DefaultConstantUniforms
impl DefaultConstantUniforms
pub fn new(screen_size: PhysicalSizeI32, scale_factor: ScaleFactor) -> Self
pub fn layout_buffer_and_bind_group( device: &Device, ) -> (BindGroupLayout, Buffer, BindGroup)
pub fn prepare_buffer( buffer: &Buffer, screen_size: PhysicalSizeI32, scale_factor: ScaleFactor, queue: &Queue, )
pub fn entry(binding: u32) -> BindGroupLayoutEntry
Trait Implementations§
Source§impl Clone for DefaultConstantUniforms
impl Clone for DefaultConstantUniforms
Source§fn clone(&self) -> DefaultConstantUniforms
fn clone(&self) -> DefaultConstantUniforms
Returns a copy 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 DefaultConstantUniforms
impl Debug for DefaultConstantUniforms
impl Copy for DefaultConstantUniforms
impl Pod for DefaultConstantUniforms
Auto Trait Implementations§
impl Freeze for DefaultConstantUniforms
impl RefUnwindSafe for DefaultConstantUniforms
impl Send for DefaultConstantUniforms
impl Sync for DefaultConstantUniforms
impl Unpin for DefaultConstantUniforms
impl UnwindSafe for DefaultConstantUniforms
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§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
.Source§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
.