Struct egui_wgpu_backend::RenderPass

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

RenderPass to render a egui based GUI.

Implementations§

source§

impl RenderPass

source

pub fn new( device: &Device, output_format: TextureFormat, msaa_samples: u32 ) -> Self

Creates a new render pass to render a egui UI.

If the format passed is not a *Srgb format, the shader will automatically convert to sRGB colors in the shader.

source

pub fn execute( &self, encoder: &mut CommandEncoder, color_attachment: &TextureView, paint_jobs: &[ClippedPrimitive], screen_descriptor: &ScreenDescriptor, clear_color: Option<Color> ) -> Result<(), BackendError>

Executes the egui render pass. When clear_color is not None, the output target will get cleared with clear_color before writing to it.

source

pub fn execute_with_renderpass<'rpass>( &'rpass self, rpass: &mut RenderPass<'rpass>, paint_jobs: &[ClippedPrimitive], screen_descriptor: &ScreenDescriptor ) -> Result<(), BackendError>

Executes the egui render pass onto an existing wgpu renderpass.

source

pub fn add_textures( &mut self, device: &Device, queue: &Queue, textures: &TexturesDelta ) -> Result<(), BackendError>

Updates the texture used by egui for the fonts etc. Should be called before execute().

source

pub fn remove_textures( &mut self, textures: TexturesDelta ) -> Result<(), BackendError>

Remove the textures egui no longer needs. Should be called after execute()

source

pub fn egui_texture_from_wgpu_texture( &mut self, device: &Device, texture: &TextureView, texture_filter: FilterMode ) -> TextureId

Registers a wgpu::Texture with a egui::TextureId.

This enables the application to reference the texture inside an image ui element. This effectively enables off-screen rendering inside the egui UI. Texture must have the texture format TextureFormat::Rgba8UnormSrgb and Texture usage TextureUsage::SAMPLED.

source

pub fn update_egui_texture_from_wgpu_texture( &mut self, device: &Device, texture: &TextureView, texture_filter: FilterMode, id: TextureId ) -> Result<(), BackendError>

Registers a wgpu::Texture with an existing egui::TextureId.

This enables applications to reuse TextureIds.

source

pub fn egui_texture_from_wgpu_texture_with_sampler_options( &mut self, device: &Device, texture: &TextureView, sampler_descriptor: SamplerDescriptor<'_> ) -> TextureId

Registers a wgpu::Texture with a egui::TextureId while also accepting custom wgpu::SamplerDescriptor options.

This allows applications to specify individual minification/magnification filters as well as custom mipmap and tiling options.

The Texture must have the format TextureFormat::Rgba8UnormSrgb and usage TextureUsage::SAMPLED. Any compare function supplied in the SamplerDescriptor will be ignored.

source

pub fn update_egui_texture_from_wgpu_texture_with_sampler_options( &mut self, device: &Device, texture: &TextureView, sampler_descriptor: SamplerDescriptor<'_>, id: TextureId ) -> Result<(), BackendError>

Registers a wgpu::Texture with an existing egui::TextureId while also accepting custom wgpu::SamplerDescriptor options.

This allows applications to reuse TextureIds created with custom sampler options.

source

pub fn update_buffers( &mut self, device: &Device, queue: &Queue, paint_jobs: &[ClippedPrimitive], screen_descriptor: &ScreenDescriptor )

Uploads the uniform, vertex and index data used by the render pass. Should be called before execute().

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,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,