Struct egui_wgpu_backend::RenderPass [−][src]
pub struct RenderPass { /* fields omitted */ }
Expand description
RenderPass to render a egui based GUI.
Implementations
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.
pub fn execute(
&self,
encoder: &mut CommandEncoder,
color_attachment: &TextureView,
paint_jobs: &[ClippedMesh],
screen_descriptor: &ScreenDescriptor,
clear_color: Option<Color>
) -> Result<(), BackendError>
pub fn execute(
&self,
encoder: &mut CommandEncoder,
color_attachment: &TextureView,
paint_jobs: &[ClippedMesh],
screen_descriptor: &ScreenDescriptor,
clear_color: Option<Color>
) -> Result<(), BackendError>
Executes the egui render pass. When clear_on_draw
is set, the output target will get cleared before writing to it.
pub fn execute_with_renderpass<'rpass>(
&'rpass self,
rpass: &mut RenderPass<'rpass>,
paint_jobs: &[ClippedMesh],
screen_descriptor: &ScreenDescriptor
) -> Result<(), BackendError>
pub fn execute_with_renderpass<'rpass>(
&'rpass self,
rpass: &mut RenderPass<'rpass>,
paint_jobs: &[ClippedMesh],
screen_descriptor: &ScreenDescriptor
) -> Result<(), BackendError>
Executes the egui render pass onto an existing wgpu renderpass.
Updates the texture used by egui for the fonts etc. Should be called before execute()
.
Updates the user textures that the app allocated. Should be called before execute()
.
pub fn egui_texture_from_wgpu_texture(
&mut self,
device: &Device,
texture: &Texture,
texture_filter: FilterMode
) -> TextureId
pub fn egui_texture_from_wgpu_texture(
&mut self,
device: &Device,
texture: &Texture,
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
.
pub fn update_egui_texture_from_wgpu_texture(
&mut self,
device: &Device,
texture: &Texture,
texture_filter: FilterMode,
id: TextureId
) -> Result<(), BackendError>
pub fn update_egui_texture_from_wgpu_texture(
&mut self,
device: &Device,
texture: &Texture,
texture_filter: FilterMode,
id: TextureId
) -> Result<(), BackendError>
Registers a wgpu::Texture
with an existing egui::TextureId
.
This enables applications to reuse TextureId
s.
pub fn egui_texture_from_wgpu_texture_with_sampler_options(
&mut self,
device: &Device,
texture: &Texture,
sampler_descriptor: SamplerDescriptor<'_>
) -> TextureId
pub fn egui_texture_from_wgpu_texture_with_sampler_options(
&mut self,
device: &Device,
texture: &Texture,
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.
pub fn update_egui_texture_from_wgpu_texture_with_sampler_options(
&mut self,
device: &Device,
texture: &Texture,
sampler_descriptor: SamplerDescriptor<'_>,
id: TextureId
) -> Result<(), BackendError>
pub fn update_egui_texture_from_wgpu_texture_with_sampler_options(
&mut self,
device: &Device,
texture: &Texture,
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 TextureId
s created with custom sampler options.
pub fn update_buffers(
&mut self,
device: &Device,
queue: &Queue,
paint_jobs: &[ClippedMesh],
screen_descriptor: &ScreenDescriptor
)
pub fn update_buffers(
&mut self,
device: &Device,
queue: &Queue,
paint_jobs: &[ClippedMesh],
screen_descriptor: &ScreenDescriptor
)
Uploads the uniform, vertex and index data used by the render pass.
Should be called before execute()
.