Skip to main content

RendererBackend

Struct RendererBackend 

Source
pub struct RendererBackend {
    pub base: RendererBackendBase,
    /* private fields */
}
Expand description

webgpu::RendererBackend: embedded by the platform backends, which implement gfx::RendererBackend by delegating to it.

Fields§

§base: RendererBackendBase

Implementations§

Source§

impl RendererBackend

Source

pub fn new(context_mode: ContextMode) -> Self

Source

pub fn backend_impl(&self) -> &Rc<BackendImpl>

Source

pub fn create_context(&self) -> Rc<Context>

createContext()

Source

pub fn activate(&self)

activate() / deactivate(): activation logic if needed (none).

Source

pub fn deactivate(&self)

Source

pub fn init_shaders( &self, registry: &ShaderRegistry, program_parameters: &ProgramParameters, )

initShaders: register one webgpu::ShaderGroup per built-in shader.

C++ registers all 31 types; a type whose WGSL is not part of this build is skipped (TODO(port): all sources once the @maplibre//:webgpu-shader-headers filegroup feeds the extractor). A duplicate registration is an error, as in C++ (which throws).

Source

pub fn set_instance(&self, instance: Option<Instance>)

Source

pub fn set_device(&self, device: Option<Device>)

Source

pub fn set_queue(&self, queue: Option<Queue>)

Source

pub fn get_instance(&self) -> Option<Instance>

Source

pub fn get_device(&self) -> Option<Device>

Source

pub fn get_queue(&self) -> Option<Queue>

Source

pub fn set_depth_stencil_format(&self, format: Option<TextureFormat>)

Source

pub fn get_depth_stencil_format(&self) -> Option<TextureFormat>

Source

pub fn set_color_format(&self, format: Option<TextureFormat>)

Source

pub fn get_color_format(&self) -> Option<TextureFormat>

Trait Implementations§

Source§

impl Drop for RendererBackend

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. 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> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

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