pub struct WgpuSnapshotExecutor { /* private fields */ }Expand description
Context-free WGPU state. On native WGPU backends it is automatically Send.
Move this value to the render thread. Target generation changes, external registrations, and device resources all belong to that thread. It never binds or dereferences a live Context.
Implementations§
Source§impl WgpuSnapshotExecutor
impl WgpuSnapshotExecutor
Sourcepub fn set_target(
&mut self,
viewport: Id,
native: Option<NativeWindowTarget>,
) -> RendererResult<WgpuSnapshotTarget>
pub fn set_target( &mut self, viewport: Id, native: Option<NativeWindowTarget>, ) -> RendererResult<WgpuSnapshotTarget>
Registers or replaces the resources associated with a viewport.
Call this whenever the host replaces its render-target allocation or native registration. Queued submissions carrying an earlier capability are rejected before texture mutation.
Sourcepub fn retire_target(
&mut self,
target: WgpuSnapshotTarget,
) -> RendererResult<()>
pub fn retire_target( &mut self, target: WgpuSnapshotTarget, ) -> RendererResult<()>
Retires an exact generation. Stale or foreign capabilities cannot retire a newer target.
Sourcepub fn set_gamma_mode(&mut self, mode: GammaMode)
pub fn set_gamma_mode(&mut self, mode: GammaMode)
Selects the same gamma policy used by the synchronous renderer.
Sourcepub fn register_external_texture(
&mut self,
view: &TextureView,
) -> RendererResult<ExternalTextureId>
pub fn register_external_texture( &mut self, view: &TextureView, ) -> RendererResult<ExternalTextureId>
Registers an external view on this executor’s device. The application owns its contents.
Sourcepub fn external_texture_binding(
&self,
texture: ExternalTextureId,
) -> RendererResult<ExternalTextureBinding>
pub fn external_texture_binding( &self, texture: ExternalTextureId, ) -> RendererResult<ExternalTextureBinding>
Returns the current external view revision, independently of its content frame.
Sourcepub fn update_external_texture(
&mut self,
texture: ExternalTextureId,
view: &TextureView,
) -> RendererResult<()>
pub fn update_external_texture( &mut self, texture: ExternalTextureId, view: &TextureView, ) -> RendererResult<()>
Replaces a view and invalidates its cached bind group after a successful revision change.
Sourcepub fn unregister_external_texture(
&mut self,
texture: ExternalTextureId,
) -> RendererResult<()>
pub fn unregister_external_texture( &mut self, texture: ExternalTextureId, ) -> RendererResult<()>
Removes an external mapping. The host must retain resources used by in-flight GPU work.
Sourcepub fn prepare(
&mut self,
submission: WgpuSnapshotSubmission,
) -> Result<WgpuPreparedSnapshot<'_>, WgpuSnapshotError>
pub fn prepare( &mut self, submission: WgpuSnapshotSubmission, ) -> Result<WgpuPreparedSnapshot<'_>, WgpuSnapshotError>
Validates the captured identity and applies owned managed requests without recording.
Texture feedback is committed for every request on failure. Earlier successful uploads retain their acknowledgements; the failing and remaining requests request retry. Stale epochs use superseded feedback so delayed work cannot resurrect retired GPU resources.