Renderer

Struct Renderer 

Source
pub struct Renderer {
    pub device: Device,
    /* private fields */
}

Fields§

§device: Device

Implementations§

Source§

impl Renderer

Source

pub async fn for_surface( surface: Surface, instance: &Instance, sample_count: u32, ) -> Result<Self, Error>

Source

pub async fn offscreen( adapter: &Adapter, sample_count: u32, ) -> Result<Self, Error>

Source

pub const fn sample_count(&self) -> u32

Source

pub fn configure<PresentMode: Into<PresentMode>>( &mut self, size: Size<u32, ScreenSpace>, mode: PresentMode, format: TextureFormat, )

Source

pub fn current_frame(&self) -> Result<RenderFrame, SurfaceError>

Source

pub fn texture( &self, size: Size<u32, ScreenSpace>, format: TextureFormat, usage: TextureUsages, multisampled: bool, ) -> Texture

Source

pub fn framebuffer( &self, size: Size<u32, ScreenSpace>, format: TextureFormat, ) -> Framebuffer

Source

pub fn zbuffer(&self, size: Size<u32, ScreenSpace>) -> DepthBuffer

Source

pub fn vertex_buffer<T>(&self, verts: &[T]) -> VertexBuffer
where T: 'static + Copy + Pod,

Source

pub fn uniform_buffer<T>(&self, buf: &[T]) -> UniformBuffer
where T: Pod + 'static + Copy,

Source

pub fn binding_group( &self, layout: &BindingGroupLayout, binds: &[&dyn Bind], ) -> BindingGroup

Source

pub fn sampler(&self, min_filter: FilterMode, mag_filter: FilterMode) -> Sampler

Source

pub fn pipeline<T>(&self, blending: Blending, format: TextureFormat) -> T
where T: AbstractPipeline<'static>,

Source

pub fn read<F>( &mut self, fb: &Framebuffer, f: F, ) -> Result<(), BufferAsyncError>
where F: 'static + FnOnce(&[Bgra8]),

Source

pub fn update_pipeline<'a, T>(&mut self, pip: &'a T, p: T::PrepareContext)
where T: AbstractPipeline<'a>,

Source

pub fn frame(&mut self) -> Frame

Source

pub fn present(&mut self, frame: Frame)

Source

pub fn submit<T: Copy>(&mut self, commands: &[Op<'_, T>])

Trait Implementations§

Source§

impl Debug for Renderer

Source§

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

Formats the value using the given formatter. 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> 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>,

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>