Struct egui_wgpu::renderer::RenderPass
source · [−]pub struct RenderPass {
pub paint_callback_resources: TypeMap,
/* private fields */
}
Expand description
Render pass to render a egui based GUI.
Fields
paint_callback_resources: TypeMap
Storage 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 RenderPass
impl RenderPass
sourcepub fn new(
device: &Device,
output_format: TextureFormat,
msaa_samples: u32
) -> Self
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.
sourcepub fn execute(
&self,
encoder: &mut CommandEncoder,
color_attachment: &TextureView,
paint_jobs: &[ClippedPrimitive],
screen_descriptor: &ScreenDescriptor,
clear_color: Option<Color>
)
pub fn execute(
&self,
encoder: &mut CommandEncoder,
color_attachment: &TextureView,
paint_jobs: &[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: &[ClippedPrimitive],
screen_descriptor: &ScreenDescriptor
)
pub fn execute_with_renderpass<'rpass>(
&'rpass self,
rpass: &mut RenderPass<'rpass>,
paint_jobs: &[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 !RefUnwindSafe for RenderPass
impl Send for RenderPass
impl Sync for RenderPass
impl Unpin for RenderPass
impl !UnwindSafe for RenderPass
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more