pub struct WebGpuRing;Expand description
A BorrowedTarget’s part on WebGPU: both sides share the device’s
queue, so frames need no separate sync objects.
Trait Implementations§
Source§impl RingBackend for WebGpuRing
impl RingBackend for WebGpuRing
Source§fn new(
_backend: &mut RendererBackend,
textures: &BorrowedTextures,
producer: SyncKind,
) -> Result<Self, Error>
fn new( _backend: &mut RendererBackend, textures: &BorrowedTextures, producer: SyncKind, ) -> Result<Self, Error>
Fails as BorrowedTextures::check does, and with
ErrorKind::Unsupported for a producer kind
the target can’t hand over.
Source§fn check_replacement(
&self,
current: &BorrowedTextures,
next: &BorrowedTextures,
) -> Result<(), Error>
fn check_replacement( &self, current: &BorrowedTextures, next: &BorrowedTextures, ) -> Result<(), Error>
Fails with ErrorKind::Unsupported for another
format or depth format, or depth textures where the ring had none, and
as BorrowedTextures::check does.
Source§fn targets(
gpu: &WebGpu,
textures: &BorrowedTextures,
) -> Result<TargetFormats, Error>
fn targets( gpu: &WebGpu, textures: &BorrowedTextures, ) -> Result<TargetFormats, Error>
Fails with ErrorKind::Unsupported for a color
format that WebGpu has no texture of.
Source§type Renderer = RendererBackend
type Renderer = RendererBackend
The backend that the target is built on.
Source§type Textures = BorrowedTextures
type Textures = BorrowedTextures
The host’s textures.
Source§type Wait = !
type Wait = !
What the next frame drawn into a slot waits for: the host’s reads of
the slot’s texture.
Source§type Handed = !
type Handed = !
What a slot’s last frame handed the host and the target keeps until
the host gives the slot back, such as a sync file.
Source§fn import(
gpu: &mut WebGpu,
textures: &BorrowedTextures,
slot: usize,
depth: bool,
) -> Result<TextureId, GpuError>
fn import( gpu: &mut WebGpu, textures: &BorrowedTextures, slot: usize, depth: bool, ) -> Result<TextureId, GpuError>
Imports the host’s color texture at
slot into gpu, or with
depth, its depth and stencil texture.Source§fn wait_for(
&mut self,
_gpu: &mut WebGpu,
consumer: ConsumerSync,
) -> Result<Option<Infallible>, Error>
fn wait_for( &mut self, _gpu: &mut WebGpu, consumer: ConsumerSync, ) -> Result<Option<Infallible>, Error>
What the next frame drawn into a slot waits for, once the host gave
the slot back with
consumer, or None when it waits for nothing.Source§fn wait_before_using(
gpu: &mut Self::Gpu,
texture: TextureId,
wait: &Self::Wait,
) -> Result<(), GpuError>
fn wait_before_using( gpu: &mut Self::Gpu, texture: TextureId, wait: &Self::Wait, ) -> Result<(), GpuError>
Has the next submit of
gpu that draws into texture wait for
wait.Source§fn take_waits_into_next_submit(gpu: &mut Self::Gpu, texture: TextureId)
fn take_waits_into_next_submit(gpu: &mut Self::Gpu, texture: TextureId)
Has the next submit of
gpu wait for what texture waits for,
though nothing drew into it.Source§fn forget_waits(gpu: &mut Self::Gpu, texture: TextureId) -> bool
fn forget_waits(gpu: &mut Self::Gpu, texture: TextureId) -> bool
Drops what
texture waits for, which no submit of gpu takes now.
Returns whether it waited for something, which no pass took: false
where a pass that drew into it took its waits into a submit.Source§fn waited(gpu: &mut Self::Gpu, wait: Self::Wait)
fn waited(gpu: &mut Self::Gpu, wait: Self::Wait)
A submit of
gpu took wait, or may have, which the ring lets go of
once the work submitted so far and the next submit’s is done.Source§fn prepare_submit(
&mut self,
gpu: &mut Self::Gpu,
textures: &Self::Textures,
slot: Option<usize>,
) -> bool
fn prepare_submit( &mut self, gpu: &mut Self::Gpu, textures: &Self::Textures, slot: Option<usize>, ) -> bool
Prepares the ring’s commands for submission, before the target flushes
and signals the producer’s sync.
slot is the slot of the frame
ending, or None when the target is releasing or replacing its
textures. Returning false drops the frame.Source§fn signal_after_next_submit(&mut self, gpu: &mut Self::Gpu)
fn signal_after_next_submit(&mut self, gpu: &mut Self::Gpu)
Has the next submit of
gpu signal the object that the host waits
on for a frame, for a producer kind that names one.Source§fn producer_sync(
&mut self,
gpu: &mut Self::Gpu,
) -> Option<(GpuSync, Option<Self::Handed>)>
fn producer_sync( &mut self, gpu: &mut Self::Gpu, ) -> Option<(GpuSync, Option<Self::Handed>)>
The sync that the host waits for, once the frame was submitted, for
a producer kind that names an object, and what the slot keeps of it
until the host gives it back.
None when there is none, which drops
the frame. A frame that hands nothing to keep leaves what the slot
kept of an earlier frame until the host gives the slot back.Source§fn release_handed(gpu: &mut Self::Gpu, handed: Self::Handed)
fn release_handed(gpu: &mut Self::Gpu, handed: Self::Handed)
Releases what a frame or texture release handed the host, with
gpu,
when the target drops it before its own Drop.Source§fn tear_down(&mut self, gpu: &mut Self::Gpu)
fn tear_down(&mut self, gpu: &mut Self::Gpu)
Lets go of the objects that the frames signal once the work
submitted so far is done, as the target goes.
Source§fn wait_for_frames(&self, what: &str)
fn wait_for_frames(&self, what: &str)
Blocks until the work submitted so far is done, where the backend
must before a target dropped without its tear-down, and so without
the
Gpu to defer to, lets go of what the frames used. Logs what
was going on when the wait fails.Auto Trait Implementations§
impl Forget for WebGpuRing
impl Freeze for WebGpuRing
impl Move for WebGpuRing
impl RefUnwindSafe for WebGpuRing
impl Send for WebGpuRing
impl Sync for WebGpuRing
impl Unpin for WebGpuRing
impl UnsafeUnpin for WebGpuRing
impl UnwindSafe for WebGpuRing
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
Mutably borrows from an owned value. Read more