Skip to main content

GpuFrame

Struct GpuFrame 

Source
#[non_exhaustive]
pub struct GpuFrame<'a> { /* private fields */ }
Expand description

One frame of a GPU view, as its renderer encodes it.

Implementations§

Source§

impl<'a> GpuFrame<'a>

Source

pub fn new(parts: GpuFrameParts<'a>) -> Self

A frame of parts (made by the runtime that runs renderers).

Source

pub fn device(&self) -> &Device

The device.

Source

pub fn queue(&self) -> &Queue

The device’s queue: buffer and texture writes made here land before the frame’s commands.

Source

pub fn target(&self) -> &TextureView

Where the frame is drawn: clear it first.

Source

pub fn format(&self) -> TextureFormat

The target’s format: 8-bit unsigned normalized, RGBA or BGRA.

Source

pub fn width(&self) -> u32

The target’s width in pixels.

Source

pub fn height(&self) -> u32

The target’s height in pixels.

Source

pub fn scale(&self) -> f32

Pixels per point.

Source

pub fn size(&self) -> Size<Points>

The view’s size in points.

Source

pub fn time(&self) -> Duration

Since the renderer was made: what an animation reads.

Source

pub fn encoder(&mut self) -> &mut CommandEncoder

The encoder the frame’s commands go to; NSH submits it.

Source

pub fn emit(&mut self, name: &str, data: JsonValue)

Emits event name with data: the view’s on<Name> handler (Rust: on_native_event) gets it.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for GpuFrame<'a>

§

impl<'a> !UnwindSafe for GpuFrame<'a>

§

impl<'a> Forget for GpuFrame<'a>

§

impl<'a> Freeze for GpuFrame<'a>
where &'a Device: Freeze, &'a Queue: Freeze, &'a TextureView: Freeze, &'a mut CommandEncoder: Freeze, &'a mut Vec<GpuEvent>: Freeze,

§

impl<'a> Move for GpuFrame<'a>

§

impl<'a> Send for GpuFrame<'a>
where &'a Device: Send, &'a Queue: Send, &'a TextureView: Send, Arc<Global>: Send, NonZero<u64>: Send, Arc<Mutex<ErrorSinkRaw>>: Send, Arc<Mutex<DeferredCommandBufferActions>>: Send, RawVecInner: Send, Arc<str>: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl<'a> Sync for GpuFrame<'a>
where Arc<CoreDevice>: Sync, Arc<CoreQueue>: Sync, Arc<CoreTextureView>: Sync, Arc<CoreTexture>: Sync, InternalBitFlags: Sync, Arc<Global>: Sync, NonZero<u64>: Sync, Arc<Mutex<ErrorSinkRaw>>: Sync, Arc<Mutex<DeferredCommandBufferActions>>: Sync, RawVecInner: Sync, Arc<str>: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl<'a> Unpin for GpuFrame<'a>
where &'a Device: Unpin, &'a Queue: Unpin, &'a TextureView: Unpin, &'a mut CommandEncoder: Unpin, &'a mut Vec<GpuEvent>: Unpin,

§

impl<'a> UnsafeUnpin for GpuFrame<'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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
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,