#[non_exhaustive]pub struct WgpuPaintContext {
pub device: Arc<Device>,
pub queue: Arc<Queue>,
pub target_view: TextureView,
pub surface_format: TextureFormat,
pub target_size: (u32, u32),
}Expand description
GPU handle passed to widgets via DrawCtx::gl_paint on the wgpu backend.
All fields are owned (cloned Arc<...> for device/queue, wgpu::TextureView
is internally ref-counted) so the struct is 'static and works with the
&dyn std::any::Any plumbing of agg_gui::GlPaint.
Painters create their own wgpu::CommandEncoder and submit it via
queue.submit(...). WgpuGfxCtx flushes any pending 2-D commands
before invoking the painter, so submissions interleave in the natural
paint order without an explicit barrier.
Constructed by the renderer and handed to painters — #[non_exhaustive]
so more GPU state can be threaded through without a breaking release.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.device: Arc<Device>Device used to build pipelines, buffers, and textures.
queue: Arc<Queue>Queue used to submit the painter’s command encoder.
target_view: TextureViewRender-target view — same surface or layer texture the 2-D pipeline
is rendering to this frame. Painters open render passes against it
with LoadOp::Load to overlay on existing content.
surface_format: TextureFormatFormat of target_view — needed for pipeline ColorTargetState.
target_size: (u32, u32)Full target dimensions in physical pixels.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WgpuPaintContext
impl !UnwindSafe for WgpuPaintContext
impl Freeze for WgpuPaintContext
impl Send for WgpuPaintContext
impl Sync for WgpuPaintContext
impl Unpin for WgpuPaintContext
impl UnsafeUnpin for WgpuPaintContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more