Struct egui_fltk_frontend::RenderPass
source · [−]pub struct RenderPass<'a> {
pub paint_callback_resources: TypeMap,
/* private fields */
}Expand description
Render pass to render a egui based GUI.
Fields
paint_callback_resources: TypeMapStorage for use by [egui::PaintCallback]’s that need to store resources such as render
pipelines that must have the lifetime of the renderpass.
Implementations
sourceimpl<'a> RenderPass<'a>
impl<'a> RenderPass<'a>
sourcepub fn new(
device: &Device,
texture_format: TextureFormat,
msaa_samples: u32
) -> Self
pub fn new(
device: &Device,
texture_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.
sourcepub fn execute(
&self,
encoder: &mut CommandEncoder,
color_attachment: &TextureView,
paint_jobs: Vec<ClippedPrimitive>,
screen_descriptor: &ScreenDescriptor,
clear_color: Option<Color>
)
pub fn execute(
&self,
encoder: &mut CommandEncoder,
color_attachment: &TextureView,
paint_jobs: Vec<ClippedPrimitive>,
screen_descriptor: &ScreenDescriptor,
clear_color: Option<Color>
)
Executes the egui render pass.
sourcepub fn execute_with_renderpass<'rpass>(
&'rpass self,
rpass: &mut RenderPass<'rpass>,
paint_jobs: Vec<ClippedPrimitive>,
screen_descriptor: &ScreenDescriptor
)
pub fn execute_with_renderpass<'rpass>(
&'rpass self,
rpass: &mut RenderPass<'rpass>,
paint_jobs: Vec<ClippedPrimitive>,
screen_descriptor: &ScreenDescriptor
)
Executes the egui render pass onto an existing wgpu renderpass.
sourcepub fn update_texture(
&mut self,
device: &Device,
queue: &Queue,
id: TextureId,
image_delta: &ImageDelta
)
pub fn update_texture(
&mut self,
device: &Device,
queue: &Queue,
id: TextureId,
image_delta: &ImageDelta
)
Should be called before execute().
pub fn free_texture(&mut self, id: &TextureId)
sourcepub fn texture(&self, id: &TextureId) -> Option<&(Option<Texture>, BindGroup)>
pub fn texture(&self, id: &TextureId) -> Option<&(Option<Texture>, BindGroup)>
Get the WGPU texture and bind group associated to a texture that has been allocated by egui.
This could be used by custom paint hooks to render images that have been added through with
egui_extras::RetainedImage
or egui::Context::load_texture.
sourcepub fn register_native_texture(
&mut self,
device: &Device,
texture: &TextureView,
texture_filter: FilterMode
) -> TextureId
pub fn register_native_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.
sourcepub fn register_native_texture_with_sampler_options(
&mut self,
device: &Device,
texture: &TextureView,
sampler_descriptor: SamplerDescriptor<'_>
) -> TextureId
pub fn register_native_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.
sourcepub fn update_buffers(
&mut self,
device: &Device,
queue: &Queue,
paint_jobs: &[ClippedPrimitive],
screen_descriptor: &ScreenDescriptor
)
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
impl<'a> !RefUnwindSafe for RenderPass<'a>
impl<'a> Send for RenderPass<'a>
impl<'a> Sync for RenderPass<'a>
impl<'a> Unpin for RenderPass<'a>
impl<'a> !UnwindSafe for RenderPass<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more