Skip to main content

NullBackend

Struct NullBackend 

Source
pub struct NullBackend { /* private fields */ }
Expand description

Headless-Backend fuer Tests, CI und Pi-Betrieb ohne Display: zaehlt nur mit, was gerendert wuerde.

Implementations§

Source§

impl NullBackend

Source

pub fn rendered_frames(&self) -> u64

Source

pub fn drawn_batches(&self) -> u64

Source

pub fn size(&self) -> (u32, u32)

Aktuelle Zielgroesse in Pixeln (mind. 1x1).

Trait Implementations§

Source§

impl Debug for NullBackend

Source§

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

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

impl Default for NullBackend

Source§

fn default() -> NullBackend

Returns the “default value” for a type. Read more
Source§

impl GfxBackend for NullBackend

Source§

fn name(&self) -> &'static str

Stabil, menschenlesbar (“wgpu-vulkan”, “software”, …).
Source§

fn init(&mut self) -> Result<(), GfxError>

Geraet/Pipelines anlegen; muss vor dem ersten render laufen.
Source§

fn resize(&mut self, width: u32, height: u32)

Groesse des Zeichenziels (in Pixeln) aendern.
Source§

fn render( &mut self, _camera: &Camera, batches: &[DrawBatch<'_>], ) -> Result<(), GfxError>

Eine Szene rendern. batches ist sortiert (opaque zuerst).
Source§

fn upload_texture( &mut self, _id: u64, _rgba: &[u8], _width: u32, _height: u32, ) -> Result<(), GfxError>

Sheet-Textur (RGBA8, dicht, 4 Byte/Pixel) unter id hochladen, damit Batches mit sprite.texture == id sie sampeln koennen. Backends ohne GPU duellen den No-op.
Source§

fn upload_cell(&mut self, _id: u64, _mesh: &Mesh) -> Result<(), GfxError>

Stream-Zelle in die GPU-Residenz uebernehmen (M3c-Handoff): ab jetzt zeichnen Batches mit cell == Some(id). Der Aufruf kommt aus der Upload-Pipeline, nie aus dem Update-Thread. Backends ohne GPU-Residenz (Null) liefern den No-op und zeichnen Zell-Batches einfach mit.
Source§

fn release_cell(&mut self, _id: u64)

GPU-Ressourcen einer Zelle freigeben. Kommt fruehestens nachdem der Handoff die Schonfrist ablaufen liess — niemals waehrend ein laufender Frame die Zelle noch zeichnet.
Source§

fn present(&mut self) -> Result<(), GfxError>

Frame ausliefern; No-op fuer headless Backends.
Source§

fn set_window_source( &mut self, _src: Arc<dyn Any + Send + Sync>, ) -> Result<(), GfxError>

Fenster-Handle als Ziel setzen (M2, Window-Backends). Read more

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> 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, 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.