Struct vello::Renderer

source ·
pub struct Renderer { /* private fields */ }
Expand description

Renders a scene into a texture or surface.

Implementations§

source§

impl Renderer

source

pub fn new(device: &Device, options: RendererOptions) -> Result<Self>

Creates a new renderer for the specified device.

source

pub fn render_to_texture( &mut self, device: &Device, queue: &Queue, scene: &Scene, texture: &TextureView, params: &RenderParams ) -> Result<()>

Renders a scene to the target texture.

The texture is assumed to be of the specified dimensions and have been created with the wgpu::TextureFormat::Rgba8Unorm format and the wgpu::TextureUsages::STORAGE_BINDING flag set.

source

pub fn render_to_surface( &mut self, device: &Device, queue: &Queue, scene: &Scene, surface: &SurfaceTexture, params: &RenderParams ) -> Result<()>

Renders a scene to the target surface.

This renders to an intermediate texture and then runs a render pass to blit to the specified surface texture.

The surface is assumed to be of the specified dimensions and have been configured with the same format passed in the constructing RendererOptionssurface_format. Panics if surface_format was None

source

pub async fn render_to_texture_async( &mut self, device: &Device, queue: &Queue, scene: &Scene, texture: &TextureView, params: &RenderParams ) -> Result<Option<BumpAllocators>>

Renders a scene to the target texture.

The texture is assumed to be of the specified dimensions and have been created with the wgpu::TextureFormat::Rgba8Unorm format and the wgpu::TextureUsages::STORAGE_BINDING flag set.

The return value is the value of the BumpAllocators in this rendering, which is currently used for debug output.

This return type is not stable, and will likely be changed when a more principled way to access relevant statistics is implemented

source

pub async fn render_to_surface_async( &mut self, device: &Device, queue: &Queue, scene: &Scene, surface: &SurfaceTexture, params: &RenderParams ) -> Result<Option<BumpAllocators>>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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,