Skip to main content

CameraBuffer

Struct CameraBuffer 

Source
pub struct CameraBuffer(/* private fields */);
Expand description

The camera buffer.

Implementations§

Source§

impl CameraBuffer

Source

pub fn new(device: &Device) -> Self

Create a new camera buffer.

Source

pub fn update(&self, queue: &Queue, camera: &impl CameraTrait, size: UVec2)

Update the camera buffer.

Source

pub fn update_with_pod(&self, queue: &Queue, pod: &CameraPod)

Update the camera buffer with CameraPod.

Trait Implementations§

Source§

impl BufferWrapper for CameraBuffer

Source§

fn buffer(&self) -> &Buffer

Returns a reference to the buffer data.
Source§

const DEFAULT_USAGES: BufferUsages = _

The default usages.
Source§

fn download<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, device: &'life1 Device, queue: &'life2 Queue, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, DownloadBufferError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: Send + Sync + 'async_trait, T: 'async_trait + NoUninit + AnyBitPattern,

Download the buffer data into a Vec.
Source§

fn prepare_download( &self, device: &Device, encoder: &mut CommandEncoder, ) -> Buffer

Prepare for downloading the buffer data. Read more
Source§

fn map_download<'life0, 'life1, 'async_trait, T>( download: &'life0 Buffer, device: &'life1 Device, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, DownloadBufferError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + NoUninit + AnyBitPattern, Self: Send + 'async_trait,

Map the download buffer to read the buffer data. Read more
Source§

fn map_download_with_poll_type<'life0, 'life1, 'async_trait, T>( download: &'life0 Buffer, device: &'life1 Device, poll_type: PollType<SubmissionIndex>, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, DownloadBufferError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + NoUninit + AnyBitPattern,

Map the download buffer to read the buffer data with custom wgpu::PollType. Read more
Source§

impl Clone for CameraBuffer

Source§

fn clone(&self) -> CameraBuffer

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CameraBuffer

Source§

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

Formats the value using the given formatter. Read more
Source§

impl FixedSizeBufferWrapper for CameraBuffer

Source§

type Pod = CameraPod

The POD element type that defines the layout/size.
Source§

fn pod_size() -> u64

Returns the size in bytes of the POD element.
Source§

fn verify_buffer_size( buffer: &Buffer, ) -> Result<(), FixedSizeBufferWrapperError>

Check if the given buffer matches the expected size. Read more
Source§

fn download_single( &self, device: &Device, queue: &Queue, ) -> impl Future<Output = Result<Self::Pod, DownloadBufferError>> + Send
where Self: Send + Sync, Self::Pod: NoUninit + AnyBitPattern,

Download a single FixedSizeBufferWrapper::Pod.
Source§

impl From<CameraBuffer> for Buffer

Source§

fn from(wrapper: CameraBuffer) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<Buffer> for CameraBuffer

Source§

type Error = FixedSizeBufferWrapperError

The type returned in the event of a conversion error.
Source§

fn try_from(buffer: Buffer) -> Result<Self, Self::Error>

Performs the conversion.

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> 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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,